cancel
Showing results for 
Search instead for 
Did you mean: 

CE 7.3: Mapping activity issue

Former Member
0 Kudos

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!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

what i do is use the count function to check first and then do the logic.

Hi Manish,

could you please give me an example for that?

Thanks in advance!

Former Member
0 Kudos

not really answered yet.

former_member182294
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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).

former_member182294
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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!

former_member182294
Active Contributor
0 Kudos

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

Former Member
0 Kudos

I solved the issue.

If I do it like this, it works:

IF(isSet(Status/DeclinedBy),

concat("Reason: ", IF(isSet(Status/DeclinedReason), Status/DeclinedReason, "")),

" ")

But don't ask me why.

For me it's still a bug.

former_member182294
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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?