Control Process Flow with Gateways
Gateways are activities that define the flow of your business process. Gateways determine the path a token takes through a business process. They define control points within your business process by splitting and merging paths. When possible, gateways are used for paths that are exceptions to, or deviate from, the default path of the business process.
Exclusive Gateway: Take Only One Path (Data Condition)
The exclusive gateway lets you split your business process into two or more paths. However, the business process only continues down one of the paths even if multiple outgoing sequence flows are present. Exclusive gateways can have conditional outgoing sequence flows and must have at least one default outgoing sequence flow.
You can define expressions that are used to determine if your process continues down a conditional sequence flow.
Evaluating the Flows of an Exclusive Gateway
When a process token reaches an exclusive gateway, the outgoing sequence flows are evaluated until one of them evaluates to True.
You can define the order in which the flows are evaluated by configuring the properties for the gateway.
-
If only one outgoing sequence flow evaluates to True, then the process token continues down that outgoing sequence flow to the next activity.
-
If more than one outgoing sequence flow evaluates to True, then the process token continues down the first sequence flow according to the order you defined in the gateway properties.
-
If none of the outgoing sequence flows evaluates to True, then the process token moves down the default outgoing sequence flow. Therefore, you must define a default outgoing sequence flow for the exclusive gateway.
Unlike other gateways, the exclusive gateway doesn’t require a corresponding merge to be explicitly defined in your process after splitting.
Note:
The exclusive gateway can also merge incoming sequence flows. However, there’s no synchronization with other tokens that may be coming from other paths within the process flow. If other tokens arrive at an exclusive gateway merge, then they’re passed through as is. If you’re synchronizing tokens or performing evaluations on incoming sequence flows, then you should use a different type of gateway.Example of an Exclusive Gateway
The following diagram shows an example of the exclusive gateway used within a Loan Approval business process. Here, the exclusive gateway is used to evaluate if the loan request is approved or if more information is required.
This evaluation is determined by the expression defined for the outgoing conditional sequence flow. If the expression evaluates to true, then the process flow proceeds down the No path. If it evaluates to false, then the process flow proceeds down the path of the default outgoing sequence flow.
Inclusive Gateway: Take One or More Paths
The inclusive gateway lets you split your business process into two or more paths. Unlike the exclusive gateway, however, a token may flow down one or more of these paths depending on how the outgoing conditional sequence flows are evaluated.
The inclusive gateway requires a split-merge pair. When you add an inclusive gateway to your business process, the split and merge flow objects are automatically created:
Description of the illustration inclusive-gateway-pair.png
The merge portion of the gateway is required. However, you don’t have to ensure that all paths out of the split return to the merge.
Although it’s possible to have process paths that split at a gateway without merging through the gateway, it’s not a good practice and not recommended.
Note:
If you delete the merge gateway from a business process, the corresponding split gateway is also deleted.Splitting and Merging Inclusive Gateways
The inclusive gateway splits a business process similar to the exclusive gateway, but allows tokens to proceed down one OR more outgoing sequence flows. You can define any number of outgoing conditional sequence flows for an inclusive gateway split. You must define at least one default sequence flow.
When a token arrives at an inclusive gateway, the expressions of its conditional sequence flows are evaluated.
Next, a token is generated for each of the conditional sequence flows that evaluates to True. A token is generated for the default sequence flow only if none of the conditional sequence flows evaluate to True.
These tokens are joined at the merge of the inclusive gateway. When a token reaches the merge gateway, it waits until all the tokens generated by the split have reached the merge. After all the tokens have reached the merge of the inclusive gateway, the merge is complete, and the token continues to the next sequence flow after the gateway.
The token proceeds along all the sequence flows that evaluate to True. If none of the sequence flows evaluate to True, then the token passes along the default sequence flow.
Parallel Gateway: Take All Paths Simultaneously
The parallel gateway lets you split your business process into two or more paths when you want your process flow to follow all paths simultaneously. The parallel gateway is useful when your business process must perform multiple tasks in parallel.
The parallel gateway requires a split-merge pair. When you add a parallel gateway to your business process, the split and merge flow objects are automatically created:
Description of the illustration parallel-gateway-pair.png
The merge portion of the gateway is required. However, you don’t have to ensure that all paths out of the split return to the merge.
Although it’s possible to have process paths that split at a gateway without merging through the gateway, it’s not a good practice and not recommended.
Note:
If you delete the merge gateway from a business process, the corresponding split gateway is also deleted.Splitting and Merging Parallel Gateways
When a token arrives at a parallel gateway, the parallel gateway creates a token for each outgoing sequence flow. The split of the parallel gateway doesn’t evaluate any of the outgoing sequence flows.
You can also use the parallel gateway to merge process paths split by the parallel gateway. The merge of the parallel gateway waits for a token to arrive from each of the incoming sequence flows. After all tokens arrive, only one token is passed to the outgoing sequence flow.
Note:
You must design your business process so that a token arrives for each incoming sequence flow for the merging parallel gateway. If you don’t, your business process can freeze if the merge is expecting tokens that don’t arrive.Example of a Parallel Gateway
In this example, a Sales Quote process uses a parallel gateway at the approval stage. The diagram shows how the parallel gateway is used to execute all process paths at the same time.
Description of the illustration parallel-gateway-example.png