How to write if condition in expression?

cancel
Showing results for 
Search instead for 
Did you mean: 
asheerabbas
Active Member

How to write if condition in expression?

Hi Everyone,

How can i write an if condition using expressions? I actually want to show some variable values in the documentation of the user task if a boolean is true.

Please advice.

Thank you

2 Replies
jearles
Established Member II

Re: How to write if condition in expression?

Asheer,

Could you expand on your use case a bit? What are you trying to achieve?

Thanks,
-JEarles

gdharley
Intermediate

Re: How to write if condition in expression?

The standard expression language used in Activiti is JUEL (Unified Expression Language - The Java EE 5 Tutorial ).
As far as I know, JUEL supports ternary (conditional) operators.

e.g. ${failed ? 1 : 2}

If process variable failed == true the expressions returns 1, otherwise 2.

Cheers,
Greg