cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway to model short cut AND condition?

ykphuah
Champ in-the-making
Champ in-the-making
I have a flow that needs approval from two different people, in parallel manner.

If one of them reject, the flow should continue straight away to the rejected flow.

If one of them approve, the flow should wait and see whether the second person approve it or not.

The best method that I can come up with, is to use a gateway to join back the two User Task (for approval). However, this flow doesn't have the short cut effect. After one of the person rejected, the flow will still wait for the second person.

Is Gateway the way to go for this? Or there's other components that I should be looking into?
9 REPLIES 9

jbarrez
Star Contributor
Star Contributor
You'd need a multi instance embedded subprocess. In that subprocess, have a user task for the review. Let the user task have a sequenceflow to an exclusive gw. When rejected, go to a signal throw event. On the boundary of the subprocess, catch that signal.

When someone now rejects, the whole subprocess is destroyed.

ykphuah
Champ in-the-making
Champ in-the-making
Thanks! This is what I ended up with that works!

[img]http://ibin.co/2UI3MlvChpVY[/img]

jbarrez
Star Contributor
Star Contributor
The picture seems to be missing. Could you upload it, I'm sure it helps others too.

ykphuah
Champ in-the-making
Champ in-the-making
hmm, strange, I can see it here. It is my first time using imagebin though, any other place you guys recommend?

lossril
Champ in-the-making
Champ in-the-making
I see the picture, it's way too complicated imo. I suppose I have an idea how to make it more readable and less complicated, will construct it later today when I will have some free time.

ykphuah
Champ in-the-making
Champ in-the-making
@lossril I would love to see your solution! Originally I only have the boundary event on the User Task, but I figured it doesn't work properly if the first approver approved, and then the second approver rejected.

This is the simplest working solution that I managed to come out with.

jbarrez
Star Contributor
Star Contributor
Now the picture works. Eventual consistency … 😉

@lossril: other ideas are obviously encouraged, looking forward to it 😉

lossril
Champ in-the-making
Champ in-the-making
Okay, I've tried to create something and got something pretty much resembling your implementation. I didn't use subprocess and got two boundary events on user tasks.
I suppose your implementation is a bit better because you exclude possible async hiccups by using subprocess.
http://ibin.co/2UlV7vDidSCb

jbarrez
Star Contributor
Star Contributor
@lossril: ah yes, that would work too indeed. Thanks for sharing.

I used the subprocess cause it's mentally easier to understand for me the scope of what happens. But yours works equally well i think.