If there is one issue that I see people often struggle with, then it is the use of loops in combination with gateways. The following discusses a few cases.
The following picture shows several loops in combination with a Parallel gateway, of which some are valid and some not. The same holds for the Inclusive gateway.
To understand why some loops are valid and other not, you have to realize that at the beginning of a Parallel or Inclusive gateway as many tokens are generated as there are parallel flows that run between the start and end of the gateway. To the BPM engine this translates to 1 or more threads that are instantiated.
No such restrictions are there for an exclusive gateway, because then there is only one token (thread) active at any time.
So in BPMN the following flows are not valid:
- From "crossover?", because you are going to another thread that may already have passed the point that the flow goes to. However, JDeveloper does not prevent you from doing so.
- From "loop back inside to beginning", because at the beginning of the gateway new threads would have to be instantiated for flows of which some threads may already run. JDeveloper should fail validation of such a construct.
- From "loop back inside from outside", because you would then have to go back to a thread already ended in the merge. JDeveloper should fail validation of such a construct.
The flows that are valid in BPMN are:
- From "loop back inside", as you loop back within the same thread.
- From "loop back outside to beginning" as you are re-instantiating a new set of threads for which the previous set already ended.
In case the latter does not work apply patch 23230734.