cancel
Showing results for 
Search instead for 
Did you mean: 

Process end if sequenceflow condition is not true

jlinderoth
Champ in-the-making
Champ in-the-making
Hi! I got a task fooBar with only one sequenceflow connected from it. The sequenceflow got a condition ${A==true}. My problem is when I complete the task and A is false. Then the task completes and the process ends. The behavior I wishes to have is that when A is false, I like it to stay on my task fooBar until A becomes true.

How do I get this behavior? Ive been thinking about useing multi-instances, but is that really the way to go? Whats the best Activiti practice to do it?

Thanks for your help!
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi,

In BPMN you would need to use an exclusive gateway that goes back to the task when the condition is false.
When you only have one outgoing sequence flow, the engine always takes that path independent if the condition is true or not.

Best regards,

gutlez
Champ in-the-making
Champ in-the-making
Wouldn't this be the definition of a looped activity?

Loop this activity until condition is met

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Yep… Sound like a alid construct as well.

jlinderoth
Champ in-the-making
Champ in-the-making
Thanks! Got it working now! Smiley Happy

What I did was that a I put a exclusiv gateway as you said before my sequence flow with the condition, but without a sequence flow back to the former task. That way the process throws an exception that  say there is no possible way out of the gateway and it goes back to its former task, without makeing any new task  Smiley Very Happy

Was this how you meant it?

trademak
Star Contributor
Star Contributor
Hmm not really. BPMN doesn't have a way of not taking a sequence flow when the condition is not met.
So what I meant is that you should have a second sequence flow going back to the user task, so the old task is completed and a new one is created.
Would there be a problem in your use case when a new user task is created in stead of keeping the old one?

Best regards,