Groovy condition is not working


Hi All,

I am working on this example: but when I used the claim.satisfactionLevel < 3 it simply does not show me the "Deal With Unsatisfied Customer" form.

From the log I can see the value that I am passing for satisfaction level. Please find the script, Process and log file used,

Appreciate any help.


1 answer

This one is the BEST answer!


Where is your process after the Gateway ? On which Task ? Is there a condition that leads to End3 ? If the condition that lead to End3 is also true the first valid branch is followed and it leads to End3 in your case. You can change the transition evaluation order on the Gateway.

Or you can use a proper exclusive condition to avoid that both branch can be true (depends on what you want to achieve)




Submitted by m.sulaiman78_1417356 on Mon, 06/22/2020 - 14:48

Hi Romain,

Thanks for getting back.

I want to display "Satisfied" form if the satisfaction level is greater than 3 and display Unsatisfied form if satisfied level is less than 3.

Please find the pic below showing the Groovy Script to deal with satisfied and not satisfied flow with Exclusive Gateway


The issue is when I say Satisfied Level is 2. It goes through the "Satisfied" route where it should have been "Not Satisfied" route.

Not sure what's the issue.



Submitted by m.sulaiman78_1417356 on Mon, 06/22/2020 - 15:01

I also tried by changing the Groovy script for both Satisfied and Unsatisfied to below instead of if/else

Satisfied: claim.satisfactionLevel > 3

Unsatisfied: claim.satisfactionLevel < 3

but still it goes through the satisfaction route when I enter satisfaction level is 2

Submitted by romain.bioteau on Mon, 06/22/2020 - 15:52

That's weird, what type is satisfactionLevel in your model ?

Submitted by m.sulaiman78_1417356 on Mon, 06/22/2020 - 17:27

Thanks for pointing out.

The issue was with the claim.satisfactionLevel. I used type as "TEXT" following the example from here, and think did not think twice it, that it could cause an issue.

Once change the type to INTEGER the routing is working ok.

Thanks a lot for your help Romain.