on 08-18-2011 2:25 PM
Hi there,
I have a mapping activity where I fill one attribute "Reason" using the following expression:
IF(isSet(Status/DeclinedBy),concat("Reason: ",Status/DeclinedReason),"")
If "Status/DeclinedBy" is filled, the attribute "Reason" is filled correctly, if not, my process always stops in that mapping activity (without any error message in the log).
What can be the reason for that?
To me it seems that the mapping in BPM is still quite buggy at the moment.
Thanks in advance!
As told before in the post the IF condition works on parallel instances design ie all the conditions are evaluated at the same time,so if one of the condition value is null then it should fail if one of the condition value fails. what i do is use the count function to check first and then do the logic.
Thanks
Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
not really answered yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What I suggested is to pass some default value for Status/DeclinedReason. May be you can hard code it in the expression to test if it is really a bug or not.
For your scenario when the task is not declined you do not have DeclinedReason, whatever the expression you prepared is correct:
IF(isSet(Status/DeclinedBy), concat("Reason: ", IF(isSet(Status/DeclinedReason), Status/DeclinedReason, ""))," ")
In my previous post, I just tried to explain you why it is not a bug. As said, the IF condition evaluation is done for three of the parameters. Check the CE 7.2 documentation to see how the IF condition works.
http://help.sap.com/saphelp_nw72/helpdata/en/e6/9a62d540184161aaa08af5dea3e2ee/frameset.htm
Thanks
Abhilash
Hi,
it's really desperate.
I cannot find a solution for this.
Even if I do
IF(isSet(Status/DeclinedBy),concat("Reason: ",Status/DeclinedReason), concat("Reason: ",Status/DeclinedReason))
it still only works if Status/DeclinedBy is filled.
That doesn't make sense to me!
Must be another bug in BPM (unfortunately not the first one that I discover).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eddie,
What is the cardinality of Status node? Actually in either of the case the isSet function should either return true or false. Can you check which value is returned for isSet(Status/DeclinedBy) by assigning the isSet expression to to test boolean context? And also check if condition. Once you evaluate the isSet funtion, try the below expression:
IF(isSet(Status/DeclinedBy),concat("Reason: ","Not NULL"), concat("Reason: ","NULL"))
Thanks
Abhilash
Hi Abhilash,
what you suggested works in both cases:
IF(isSet(Status/DeclinedBy),concat("Reason: ","Not NULL"), concat("Reason: ","NULL"))
If I change it to
IF(isSet(Status/DeclinedBy),concat("Reason: ",Status/DeclinedReason), concat("Reason: ","NULL"))
the process stops if Status/DeclinedBy is not set.
So it seems, that Status/DeclinedReason is causing trouble if it is not filled.
What can I do to solve the issue?
Thanks in advance!
Hi Eddie,
I guess its something to do with the DO Status/DeclinedReason. I think in your case when DeclinedBy is not initialized then DeclinedReason also not initialized. The IF expression evaluates 3 parameters all the times, hence failing when DeclinedReason is not initialized. You should check for isSet(Status/DeclinedReason) to solve this issue.
Thanks
Abhilash
Hi Eddie,
Its not a bug. The way IF condition us evaluates the three conditions is causing the error.
IF( test as xsd:boolean, thenValue as xsd:anyType*, elseValue as xsd:anyType* ) )
From the above expression the test, thenValue and elseValue are valuated first.
IF(isSet(Status/DeclinedBy),concat("Reason: ",Status/DeclinedReason),"")
So in your case, when Status/DeclinedBy has some value then Status/DeclinedReason has also some value in it. But when Status/DeclinedBy is not set then the second condition with Status/DeclinedReason also does not have value so the condition throws error. Its only the way IF condition is evaluated.
To re check you can try this, irrespective of isSet(Status/DeclinedBy) try to put default value for Status/DeclinedReason. Your first expression itself works without failure.
Thanks
Abhilash
Thanks for your support!
To re check you can try this, irrespective of isSet(Status/DeclinedBy) try to put default value for Status/DeclinedReason. Your first expression itself works without failure.
I tried now
IF(isSet(Status/DeclinedReason),concat("Reason: ",Status/DeclinedReason),"")
, but that still doesn't work.
Or what was your suggestion?
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.