Arun Pareek In a blog post (here), described a solution to a process problem where three parallel tasks are executing. When one of the tasks completes with a particular condition, he uses a complex gateway merge to halt the execution of the other tasks. He called this ‘dead path’ cleanup. The original paper on dead-path elimination is here.
For you convenience, I will show Arun’s bpmn use case here:
The use case is for a security check that verifies Citizenship, Credit and Criminal checks. The topic of the dead path was the termination of one of the tasks Citizenship or Credit, when the criminal check had passed and one of the two activities, in pink, had completed.
In the Microguide to Process Modeling in BPMN, Rick and I do not support the use of the complex merge shape because they are confusing, and hide the logic that we are trying to build with our process modeling. All the logic from a complex merge shape can be defined in a subprocess. This example is a perfect demonstration of this. The fact that the ‘criminal background check’ result will cancel the citizenship and credit is hidden in Arun’s solution. Also hidden in the solution is the fact that the 'dead-path' elimination is an Oracle specific extension.
- Places the criminal check in a subprocess and the other activities in an enclosing subprocess
- Starts these in parallel
- Raises an exception to the border of the outer subprocess if there is a failure in the criminal check
- For the credit and citizen check, the first activity to return a valid check escallates the inner subproces
escallation and errors manage the threads in the same manner. The BPMN 2.0 spec explicitly provides for thread termination with the error event plus (conditionally) the escalation event.
In my original post on this topic, several reviewers noted that I did not cover the exact use case described by Arun's post. The point of the complex merge was to cover the case where the Criminal Check passed and either the Citizenship or the Credit check passed (activities in Pink, here). In this case, you can place the Citizen Check and the Credit Check in a subprocess and when one passes then use the raise escalate the edge of the subprocess.
This shows the power of the escalate shape and makes it very clear what is happening.
While this approach requires more canvas, it is clearer what is happening and why. This said, I understand that Arun was merely demonstrating how to use a complex merge in the Oracle Tool.