cancel
Showing results for 
Search instead for 
Did you mean: 

IF-Statement

Former Member
0 Kudos

Hi everybody,

i use a IF-Statement in BPM but without success, i am not sure if it works like how i use it:


IF(DO_Context = "A",getPrincipals(myDO_Context),getPrincipal(myDO_Context)) 

In one case i have only one principal in other case i have multi principals. The action depends on DO_Context.

Is that possible? If i use only the methods it works but not with the IF-Statement.

regards,

Sid

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

maybe this is better

IF(string-equal(DO_Context, "A"),getPrincipals(myDO_Context),getPrincipal(myDO_Context))

Former Member
0 Kudos

Hi John,

I try it with string-equal(...) but unfortunately it does'n work.

I try also a simple operation like 1=1 without success.



IF( 1=1, getPrincipals(DO_BANF_Structure/genehmiger/rcdID),getPrincipal(DO_Employee/rcdCurrentUser)) 

If i use only getPrincipals(myDO_Context) it works.

Any ideas?

regards,

Sid

junwu
Active Contributor
0 Kudos

what's the type of DO_Context?

it should work, you must do something wrong. there is nothing magic, just check carefully

type the expression from scratch, do not copy

or

you can try with gateway.

Former Member
0 Kudos

I think the problem is that the IF-Statement only works with identical returnvalues, because

if i use the same returnvalue for "then" and "else" it works:



IF( true,getPrincipals(...) ,getPrincipals(...) )  <-- works

But if i use different returnvalues for "then" and "else" i get no result:



IF( true,getPrincipals(...) ,getPrincipal(...) )    <---don't work

My purpose is to bind the owner of a Human Task either to getPrincipals() or getPrincipal(). How would you realize this?

regards,

Sid

Edited by: Sid on Dec 16, 2010 11:49 AM

Former Member
0 Kudos

Hi John,

you are right. It works, my mistake was that the "elsevalue" was null so the "thenvalue" can not be returned when the "elsevalue" is null. I think the method raise an exception. Now after i set a default value it works.

regards,

Sid

Answers (0)