cancel
Showing results for 
Search instead for 
Did you mean: 

result variable type in conditionexpression

tomas
Champ in-the-making
Champ in-the-making
Hi!
i'm sorry if my following quistion is stupid or answer is too obvious, but i`m new to activiti and i was not able to find solution …
i have java class, which returns abstract Result class - and two possible Result descendants OKResult and ErrorResult. And my question is: how can i make conditionExpression in connection, where will be checked dataType of some variable?

i have serviceTask calling some springBean methid, which returns Result with resultVariable set and i need something like
${result instanceof ResultOK} and ${result instanceof ResultError} on two following connections

Thanks in advance
Tomas
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
Since you're using spring you can also put that logic in a Spring bean and call it in an expression on your sequence flow. That will probably be the easiest in your case.

tomas
Champ in-the-making
Champ in-the-making
thanks, for your answer ..
so you mean to create ban method, where will be logic that will evaluate object class, comparing it and returning true/false strings?? that can make process definition quite  difficult and confusing, i there will be few of these decision beans .. is there some other way?? in conditionexpression i can only compare string, int .. ?

trademak
Star Contributor
Star Contributor
Right that would be a possibility. What you can also do is add a type attribute to the Result classes and check that in the condition expression.

Best regards,