3
votes

Picture of the Problem

Here is my problem: All of the three sequence flows after the fork have to be checked separately and if they are negative I want to have a different process P2 being started. After P2 has been finished I want to go back into the process starting at P1 and I want to check all three sequence flows again after they have been forked.

Maybe an example helps to understand: We suppose C1 & C2 are positive, C3 is negative in the first iteration, so the system waits at the merging gateway for C3 while another iteration is started after the process P2. Now in the 2nd check C1 & C3 are positive and C2 is negative. Here is the problem: the exclusive gateway will join the sequence flows as if all checks were positive, even though C2 was negative in the 2nd iteration. I want it only to join them when ALL checks were positive in the SAME iteration.

1

1 Answers

2
votes

Join the parallel branches with a merging gateway, then check the condition with only one exclusive gateway. This is easier to understand and to maintain, because it uses less gateways.

join branches


If C1, C2 and C3 should be terminated as soon as possible, you could extract the three branches into one sub process. The sub process throws a signal if one branch fails, and the surrounding process catches it.

sub process


Without sub processes you'll need an additional exclusive gateway and connections to the merging gateways for each activity in each branch. That adds up fast, if C1, C2 and C3 aren't simple activities but sequences, but could be okay for simple workflows.

The merging gateway after P2 prevents race conditions. For example if P2 finishes before C3 and therefore the second iteration would start before the first ends.

(Eventually you need an extra parallel gateway after each activity in a branch to split the paths.)

without sub process