Why are Exclusive and Parallel Gateways critical in BPMN?

Filip Stachecki
29-02-2024

14 min

In BPMN, Gateways are very important for how processes move. Let's talk about two of the most important ones: The Exclusive Gateway and the Parallel Gateway. We'll check out why they matter, how they're used in real life, and what can go wrong if we don't use them at all.

Exclusive Gateway: Making Decisions in Processes

A BPMN Exclusive Gateway is a decision point in a process. It helps us make exclusive choices, where we are choosing a single option from two or more possible choices. Think of it like a "pick one path" sign. When a process reaches this gateway, only one way forward is chosen, based on specified conditions. It's super useful for making decisions in a process.

Source: https://orlandoespinosa.blog/2020/09/28/choose-a-path/

Example 1

Imagine a simplified online purchase process where the system needs to decide whether to offer a discount based on the total order value. Here, an Exclusive Gateway would come into play. If the order value is above a certain threshold, the flow could lead to a discount calculation task; otherwise, it could skip to the end.

Example 1a. A Gateway described with a question followed by simple conditions (yes/no)

Notation

The Exclusive Gateway symbol is shown in BPMN diagrams in two versions:

  • as a diamond shape with an X placed inside, or 
  • an empty diamond shape without an X marker.

These two versions of the symbol mean exactly the same thing, because they refer to exactly the same object: An Exclusive Gateway. You have to decide which notation you choose. You can't use both on the same diagram. So this is an important decision and it is worth following consistently.

Which version of the gateway symbol should you choose?

There are two schools of thought here.

  • Proponents of using the X marking inside the Gateway argue that this makes it immediately apparent that the gateway acts as an XOR operator - an exclusive choice. In addition, some BPMN tools (such as Camunda) do not allow the use of another version of the Gateway. 
  • Proponents of using an empty Gateway explain that it is easier to draw by hand and is not confused with a Parallel Gateway with the + symbol placed inside.

I belong to the first school. The choice, of course, is up to you. 

When you use BPMN gateways, you can also decide whether to include them in the diagram without additional description, or add text describing the question (in our case, “Is total value > threshold?”). Both conventions are allowed, it is worth opting for one of them and using it consistently.

Example 1b. A Gateway without a description followed by a more complicated condition

It is very important that the conditions described on the outgoing flows are mutually exclusive, and there is no possibility in which more than one is met.

Example 2. Incorrect example with non-exclusive conditions. In case of any value greater than 200 both conditions are met. The BPMN states that conditions for the Exclusive Gateway are checked in an unknown order. The first condition that is met determines the choice of path. In this example, we are dealing with non-deterministic behavior. We don’t know which path will be chosen because we do not know the order in which the conditions are checked. 

Default flow

There is a useful mark for the condition called default flow. The default flow in an Exclusive Gateway is like a backup plan in case none of the main conditions apply. If none of the specified conditions are met, the process will move along the default flow. This helps keep the process moving smoothly, even when things don't happen exactly as expected.

The default flow will have a diagonal slash added to the beginning of the connector.

Example 3. Default flow

Merging

So far we have used the Exclusive Gateway in a very simple way where each alternative flow has its own End Event. Now let's discuss how we can combine flows after they split apart into alternative flows after an Exclusive Gateway.

In BPMN, alternative flows can be merged using a type of Gateway, called a Converging (or closing) Gateway. 

Example 4. Separating and combining flows using Gateways

The use of a closing Gateway shows that after performing alternative paths, we can return to the common path and continue the process.

You should also know that in BPMN you can combine alternative flows without using a Converging Gateway and get exactly the same effect. 

Example 5. Different ways to combine alternative flows, each way means exactly the same thing

In general, I am in favor of using the merge gate (the Converging Gateway) explicitly because it makes it very easy to visually analyze the process. A process fragment that has explicitly marked alternative flows between two gateways - opening (diverging) and closing (converging) allows you to draw correct conclusions and correctly understand the logic of the Process. Again, both ways are correct:

Example 6. Merging alternative flows with or without a closing Gateway

Additional considerations

I am often asked: how many maximum arrows can come out of a Gateway? Is it a maximum of three because that's how many corners we have available? The answer is - it is not limited, you can have more than three.

Example 7. Four flows coming out of the Gateway

Another important thing to remember is that a Gateway does not make decisions, does not perform calculations and does not check anything. It acts as a simple mechanism to switch the token to the right path. If you need to perform a calculation or make a decision, then you need an Activity preceding the gateway. You can't take a shortcut and force the gateway to make a decision for you.

Example 8. Decisions made within Activities, not by Gateways

Many times I have seen BPMN diagrams in which conditions were described with Activities. Instead of specifying them on the flows coming out of the Gateway they became pseudo-activities. Such modeling is obviously incorrect.

Example 9. Incorrect example showing Activities used to represent conditions

Parallel Gateway: Managing Multiple Paths Concurrently

The BPMN Parallel Gateway is like a junction where the process splits or merges. It's the place where multiple things can happen at the same time. 

Why is it handy? Well, it helps manage independent Activities that do not have to be performed in a specified sequence, so they can happen at the same time.

Example 10

Consider a project approval process where different aspects, such as budget approval and resource allocation, can happen. We can determine what to do step by step.

Example 10a. A Project Approval Process executed sequentially

In the case of sequential execution, as shown above, you have to wait for one Activity to finish to start the next one.

But in the real world, some of these Activities can happen concurrently. The Parallel Gateway ensures that these tasks  can happen simultaneously, making things faster and more efficient.

Example 10b. A Project Approval Process using Parallel Gateways

Imagine you're a small company with just one person. After completing Create Project Proposal Activity, you can do the remaining three Activities in any order because it's just you doing everything. But when you have more people, the Parallel Gateways help a lot. They let you do these jobs all at the same time or in any order that works best. So, instead of doing one thing after another, Parallel Gateways help break the rule of doing things one by one and make it easier to manage tasks.

Notation

The Parallel Gateway is shown in BPMN diagrams as a diamond with a plus sign inside.

Simulation

Let's see what the simulation of our process will look like.

Merging

If we want to terminate a part of the Process in which Activities can be performed in any order then it is necessary to use a closing parallel Gateway.

Example 11. Opening and closing Parallel Gateways

Possible scenarios for the process: Activity A, then B, C, D in any order or simultaneously, and finally Activity E.

Dangers of Uncontrolled Flow

What happens when no Gateways are used? The process will execute according to the rules of the BPMN specification, which are not all that intuitive. The so-called “Uncontrolled Flow” can lead to chaos, confusion, and inefficiencies in your processes. Tasks can be performed repeatedly or in the wrong order and the whole process can become unpredictable.

To read more about uncontrolled flows see the “Messy BPMN: Uncontrolled flows, Conditional flows” article. However, if you are looking for a recipe for creating correct BPMN diagrams then using Gateways explicitly is one of the rules of correctness. If you avoid taking shortcuts using uncontrolled flows, you will ensure a smile every day and a peaceful sleep.

Conclusion

Exclusive and Parallel Gateways are your allies in creating structured, efficient, and well-controlled BPMN processes. Whether you're making decisions or managing multiple paths, these gateways provide the clarity needed for effective process modeling. 

Remember, neglecting gateways can lead to uncontrolled flow, turning your well-designed process into a maze of confusion. So, embrace the power of gateways, and navigate your processes with precision and purpose. Happy modeling!

✔❌ BPMN 2.0 Quiz (Level 1, Lesson 6) 📝

Take the BPMN 2.0 Lesson 6 Quiz