There are situations where a parallel gateway is not behaving as expected and if used as a joining gateway is not really waiting for each incoming sequence flow. The documentation at https://www.activiti.org/userguide/#bpmnParallelGateway states:
"join: all concurrent executions arriving at the parallel gateway wait in the gateway until an execution has arrived for each of the incoming sequence flow. Then the process continues past the joining gateway"
Steps to reproduce
1. Via App Designer in activiti-app import the attached app "ParallelGatewayDefect.zip" and publish it
NOTE: This app comes with a process as seen in attached process.png which validates without errors in process editor.
2. From the published app on the landing page, start a new process
3. Complete "Task A" and then complete "Task D" and inspect the process diagram for the runtime process instance: The process reached the joining parallel gateway in wait state.
4. Complete "Task B" and complete another "Task D" and inspect the process diagram for the runtime process instance once more.
The process passed by the joining parallel gateway and reached the end event.
According to the documentation, the process should still be in a wait state in the joining parallel gateway and wait for each possible incoming sequence flow (sequence flow from "Task C" was not crossed yet).
- Reproduced in latest current APS 1.8.0 release
- Completing the last outstanding "Task C" leaves the process instance in running state without any open activities.
- Even if the process is designed by not following the best practice (have at least one parallel gateway join for every parallel gateway fork), a process should never end in such a state.
- So either this is incorrect behaviour for the joining parallel gateway OR the validator in the process editor must be improved to tell process designers what is wrong with the process.