An Inclusive Gateway is similar to an Exclusive Gateway, but in this case the flow can split along multiple paths.
What's the function of an Inclusive Gateway?
The Inclusive Gateway can be similar to an Exclusive Gateway, however, it is predominantly used to control the flow of a Process downstream only. They usually have the following properties.
They allow for the condition of a branch to be in an “OR” format
They allow for the Process flow to split into multiple routes
They allow for all routes that are taken from the split to be completed at the join before the flow continues. If only one route is valid then the function of this gate is very similar to that of an Exclusive Gateway
The Inclusive Gateway tracks the number of true paths from the split along to the combining gateway by using tokens. When the combining gateway receives all the tokens from the split it allows the flow to move forward.
Care must be taken to ensure that the combining gateway receives all the tokens from the split so that it triggers the downstream flow. You'll understand more what we're talking about as we run through some examples.
Similarity to Exclusive Gateways
This example takes the Process flow shown from our discussion on Visual Remapping for Exclusive Gateways. This example functions as the Exclusive Gateway in that example as each branch is unique.
Using an "OR" type condition
In the below example, the condition for the split to Task 1 has been changed to an “OR” condition. For the combining gateway to trigger, the token must be passed to it to so that the combining gateway operates correctly. In this example if the number is 4 then both Task 4 and Task 1 are executed together.
Combining Exclusive and Inclusive Gateways
Additional conditions can be added to each branch as shown below. Care should be taken so that the splitting of any inclusive branch resolves so that the token is passed to the combining Inclusive Gateway.
In this example, Task 2 was modified so that the Number can be re-entered to avoid a permanent loop.
As seen with Exclusive Gateways it is possible to terminate the process from one of the branches, as in our Visual Remapping example. Care must be taken in these situations as they can lead to unexpected operation of the process.
It can be seen below that there is a possibility of losing the token for this Process if the number is 4. In this case both Task 1 and Task 4 are called however the exit to task 1 will split to task 6 and then terminate, thus potentially losing the token.
Potential resolution for early termination of an Inclusive Branch
In the below example, Task 1 now has two paths coming away from it on completion. One passes to the combining Inclusive Gateway to ensure that the token is passed to it, the other path passes to a conditional termination.
This is a valid use of Task 1 exit points as shown in our article, Do you need to use Gateways?. As discussed in that piece, a parallel break should be controlled by a Parallel. This change to the process will be given in the Parallel Gateway article!
The Process shown below is only valid if Task 5 is never executed in parallel with any other Task.
This example is a functional solution but it does not follow best practice as a Parallel Gateway should be used at the exit of Task 1.
Also Task 5 has a unique path and so will never execute in parallel with any other task. If Task 5 was to be executed in parallel then its token would be lost and the combining Inclusive Gateway may fail and Task 3 would never execute.