Skip to content

Gateway

Gateways are used to control how the process flows, how tokens flow through connections as they converge and diverge within a process. If the flow does not need to be controlled, then a gateway is not needed.

The term gateway implies that there is a gating mechanism that either allows or disallows passage through it. That is, as tokens arrive at a gateway, they can be merged together on input and/or split apart on output as the gateway mechanisms are invoked. A gateway is graphically visualized in a diamond shape with an icon inside it which represents the type of a gateway.

It's important to note that the conditions of a gateway are not modeled on the gateway itself, but rather on the outgoing/inboud connections. If more than one condition evaluates to true, the path that was defined first will be chosen. However, this situation should never happen in a well-designed process model.

There are four types of gateways:

Types of gateway

Parallel Gateways

Gateways are a powerful tool for modeling concurrency in a process. One of the most commonly used gateways for introducing concurrency in a process model is the parallel gateway. This type of gateway enables the forking of a process into multiple paths of execution or the joining of multiple incoming paths of execution. Parallel gateways are particularly useful for modeling scenarios where more than one path is executed in parallel.

Unlike other gateway types, parallel gateways do not have any conditions since all paths are always executed. To join parallel branches, another parallel gateway can be used. The execution of the process continues only once all paths have been completed.

Will parallel gateway evaluate conditions if there are any?

It's important to note that the parallel gateway does not evaluate conditions, even if conditions are defined on the connection connected with the gateway.

Parallel gateways do not require a "balanced" number of incoming and outgoing connections, meaning that they don't need to have an equal number of corresponding parallel gateways. When a parallel gateway is encountered in a process model, it will simply wait for all incoming sequence flows and create a concurrent path of execution for each outgoing connection. This behavior is not influenced by other constructs in the process model.

This flexibility makes the parallel gateway a powerful tool for modeling complex scenarios where multiple paths need to be executed in parallel, without the need for strict synchronization between them. However, it's important to use this feature judiciously and to ensure that the resulting process model is still clear and easily understandable.

Parallel Gateway Example

Balanced parallel gateway

Unbalanced parallel gateway

In summary, the parallel gateway is a versatile tool that allows for the modeling of complex concurrent scenarios in a process. Its ability to handle multiple paths of execution makes it a valuable addition to any process modeler's toolkit.

Exclusive Gateways

An exclusive gateway is a useful tool for creating alternative paths within a process flow. It serves as a "diversion point in the road" for a process, where only one of the paths can be taken for a given instance of the process. Exclusive gateways are one of the most commonly used elements within a process model, as they enable the modeling of decisions within a process.

If no connection can be selected, an exception will be thrown

Unlike parallel gateways, which allow all connections that evaluate to true to continue in a parallel way, only one connection can be selected when using an exclusive gateway. If multiple connections have a condition that is evaluated as true, the first one defined will be selected for continuing the process. It's important to note that if no connection can be selected, an exception will be thrown.

Exclusive Gateway Example

Exclusive gateway

In summary, the exclusive gateway is a valuable tool for modeling decision points within a process. It enables the creation of alternative paths, ensuring that the process model can handle different scenarios and provide flexibility in the execution of the process.

Inclusive Gateway

A diverging inclusive gateway is a type of gateway that can be used to create alternative but also parallel paths within a process flow. Unlike the exclusive gateway, all condition expressions on the outgoing connections are evaluated. The true evaluation of one condition expression does not exclude the evaluation of other condition expressions. All connections with a true evaluation will be traversed by a token, allowing all possible combinations of paths to be taken, from zero to all. However, it's essential to design the process in a way that ensures at least one path is taken.

To determine which route or routes the process will follow, the conditions on the outgoing connections of the inclusive gateway are checked. Each condition is modeled as an expression and must always evaluate to a boolean value of true or false. Whenever a condition evaluates to true, or if a connection has no condition, the process branches at that point, creating parallel paths. To join the inclusive branches, another inclusive gateway can be used. The execution of the process only continues once all paths have been completed.

Ensure that the at least one condition on the outgoing connections is valid

If none of the conditions evaluate to true, or if there is no connection without a condition, the process will become stuck, unable to proceed further. Therefore, it's crucial to ensure that the conditions on the outgoing connections of the inclusive gateway cover all possible scenarios and that the process can always proceed in a valid way.

Inclusive Gateway Example

Inclusive gateway

Event-Based Gateway

The Event-Based Gateway is a powerful tool for making process flow decisions based on events. Each outgoing connection from the gateway must be connected to an intermediate catching event. When the process execution reaches the Event-Based Gateway, it acts as a wait state, suspending execution. Furthermore, an event subscription is created for each outgoing sequence flow.

It is important to note that the sequence flows originating from an Event-Based Gateway are different from ordinary connections. These sequence flows are not actually executed. Instead, they enable the process engine to determine which events an execution arriving at the Event-Based Gateway should subscribe to. The following conditions must apply:

  • An event-based gateway must have two or more outgoing connections.
  • An event-based gateway must only be connected to intermediate catch events.
  • An intermediate catch event connected to an event-based gateway must have a single incoming connection.

Event-Based Gateway Example

Inclusive gateway