The Usage of BPMN Gateways
Gateways is a BPMN notation used to control how a process flows. Connected by sequence flows, a gateway acts as a decision point that decides which (outgoing) sequence flow to take based on the result of the evaluation of condition(s) specified. According to the Business Process Model and Notation (BPMN)’s definition, only sequence flow will affect the flow of activities while message flow does not. If you want to know message flow usage, please see How does BPMN message flow work? article. In this article, we will show you the different types of gateways and their behavior using the BPMN modeler featured by Visual Paradigm.
The image below gives a BPMN example diagram that uses gateways in forming a flow. The gateways are colorized in orange:
The image below gives an example of an incorrect use of gateways:
Types of gateway
BPMN defines 5 types of gateways, which include: Exclusive Gateway, Event-Based Gateway, Inclusive Gateway, Parallel Gateway, and Complex Gateway. The image below shows the graphical notation of the different types of BPMN gateways.
Exclusive gateways
An exclusive gateway is a diversion point of a business process flow. For a given instance of the process, only one of the paths can be taken. Take a look at the business process diagram below. If the order amount is greater than 1,000, we will request the customer for a deposit. If the order amount is 1,000 or less, we will deliver goods directly. There are only two possible paths of the business process and either of them will be executed, but not both. Please see the Exclusive gateways example animation.
The suggested way to mode gateways is to state the checking (question) in the gateway (diamond shape) and state the condition in the sequence flow. When the business process is executed (either by manual process or with the automatic process), the condition will be evaluated one by one and once the first condition is fulfilled, we still trigger the connected activity and stop evaluate other conditions.
Exclusive gateway with a default sequence flow
As we discussed above, an exclusive gateway only takes one outgoing path and disregard the rest. So what if the conditions of all outgoing paths are not fulfilled? In such a case, the default sequence flow will be triggered.
Inclusive gateways
An inclusive gateway is also a division point of the business process. Unlike the exclusive gateway, an inclusive gateway may trigger the execution of more than one out-going flows. Since an inclusive gateway may trigger more than one out-going flows, the condition checking process is a bit different from the exclusive gateway. Under an inclusive gateway, all the out-going conditions will be evaluated. The business process diagram below shows an example of an inclusive gateway.
Following are all possible paths of the business process
- Ship all goods by air
- Ship all goods by sea
- Ship some goods by air and others by sea.
See Inclusive gateway animation.
You can set the gateway to an inclusive gateway by popup menu. Please see the image below for detail:
Event-Based Gateway
Event-Based Gateway is similar to the exclusive gateway but the triggering of outgoing flow is based on the occurrence of an event instead of condition evaluation. When the flow arrives at an event-based gateway, the process will be paused until something has happened. An event-based gateway is usually triggered by a third party (e.g., the receipt of payment issued by a customer). The image below gives an example of an event-based gateway. We send a quotation to the customer and wait for his confirmation of the order. If the customer sends us a confirmation, we will proceed to prepare the goods for him/her. If we haven’t received any confirmation from the customer after in days, we will send the customer a reminder.
See Event-Based Gateway animation.
Parallel Gateway
A parallel gateway is used to visualize the concurrent execution of activities and is used in pairs. When the process arrives at the parallel gateway node, all the outgoing flows exhibited from the gateway will be executed simultaneously. The flow will be merged at the joining parallel gateway. The image below shows an example of a parallel gateway.
See parallel gateway animation.
Complex Gateway
A complex gateway is used to model complex synchronization behavior. We don’t suggest using a complex gateway too often. Please try to use a combination of different gateway types before deciding to use a complex gateway.
What happens with the event-based gateway when there is no response after the reminder is sent? Also after the reminder is sent, I would expect handling for a customer response depicted as a data flow from the ‘customer’ swim lane, but this is not shown on the diagram
Sure, these diagrams are only for epitomizing the notation. A full-fledged process should include the reminder pattern, with a message sent to the client, a loop back to the first gateway, and a check on the number of iterations compared to a threshold value.
The animation for the “inclusive or” gateway is not sufficient to explain its semantics. It should include a scenario where both branches are active. In such a case, the second gateway acts as demon, waiting for both activities to end, before it lets the flow pass to the process end.
In my training experience, this gateway is the one which is the most difficult to understand.
Where can I find some examples with real-life diagrams?
I am trying to model some healthcare processes with BPMN. All models is simple in the first iteration. Then more and more complexity is added as real life tasks, events, forks are added. In the end the diagram is almost unreadable. Thus it would be nice to see some real examples with all complexity added.
Complexity is dependent on who your stakeholders (viewers) are going to be. Of course any BPMN will become extremely complicated and complex if you drill down to every action and message. If you need to explain high level, use subprocesses and fill in the details of those subprocesses later (if under time constraint). If you need to explain low level, use multiple canvas (each would probably be a subprocess of a high level) and have the arrow symbol to ‘jump’ to the next diagram (with the filename the same are the arrow name). Then with your stakeholder you can focus on the details of that one piece in question. Hope this helps.