Gateways - Control the Process Flow

Objectives

After completing this lesson, you will be able to:

  • Explain how to split and merge process flows

Gateways - Control the Process Flow

Usually, in a business process, not all tasks are always executed. In most business scenarios, decisions are part of the process in order to control how to proceed in certain cases. These scenarios obviously affect the design and structure of your process model. First and foremost, this means that within the process model we have to split up the sequence flow into different paths.

In the previous lesson we learned how to use events and tasks in order to create our first own process model. We connected a start event that represented a need of being hungry with several activities of buying, preparing and eating a meal in order to reach the satisfying feeling of being not hungry anymore.

But wouldn't it be even more satisfying if we could prepare and eat a meal of our choice?

Exclusive Gateway (XOR)

Using the Exclusive Gateway for Splitting (XOR Split)

Based on our previous meal example, let's assume we have different groceries at home to cook something delicious. Driven by hunger, we must now decide about what we want to eat.

The exclusive gateway reads out the result of our decision (select meal) to guide us to the next task. The process flow is being split up into several ones but only one path can be chosen at a time.

In other word: this is an either/or decision.

Reaching the Process Goal

Add Missing Tasks

You might have noticed, there was an important factor missing in our previous example - we never ate, as the process has ended after our meal has been prepared. Our initial goal (being not hungry anymore) was not fulfilled. To be more precise: The process is not modeled completely!

So let's add the tasks to ensure we're not hungry anymore at the end of the process.

Merging Process Branches

Using the Exclusive Gateway for Merging (XOR Join)

Our previous solution at least ensures we reach our goal, but increases the complexity of our process as:

  • the "Eat meal" task does not depend on the meals, but applies the same to all different meals
  • we created the same process goal (end event) multiple times for each branch

To avoid the problems above we need to find a way of merging all split branches with the original process flow. Fortunately, we can use the exclusive gateway again like demonstrated in the image above.

Conclusion

When you split with it, merge with it!

Exclusive gateways:

  • have a splitting behavior to route to the next required task, based on a certain condition.
  • have a merging behavior, to join different branches in the process with the main flow.
  • should be used pairwise. That means, if a process flow has been split into several branches with an XOR gateway, the joining gateway should also be an XOR gateway.
  • have exceptions to this. A splitting gateway does not have to be merged if the sequence flows go to different end events. This means that the single paths are moved into different paths and do not have to be merged anymore.
Note
The BPMN standard also allows exclusive gateways to be used without having to merge them again. This is therefore not a syntax error. However, it is recommended to merge the sequence flows again with an exclusive gateway, because this way the diagram remains well-structured and errors can be avoided.

Using Exclusive Gateways as Standalone Decisions

Knowledge Check

Decision is Missing!

Gateways Don't Replace (Decisional) Tasks

Although it looks like there is a decision in the process example below, in fact there is none. A gateway alone is stateless as it's only an instrument to control the next step based on information. In contrast to tasks, a person cannot "own" (be responsible for) a gateway.

Referring to the process example below, it means:

  • The actual decision (select meal) is missing and hence never made
  • The information of a selected meal is "simply available" right from the beginning on but won't be determined as part of the process.
  • Although the XOR gateway is in Tim's lane, he is not responsible for the "routing", as a gateway is just a stateless instrument. In fact, it doesn't matter in which lane a gateway is placed. Its only important to whom the next task is assigned.

Referring to our token concept, let's have a look how the process would be executed using splitting and merging exclusive gateways.

Naming Convention for XOR Gateways

As we have seen with tasks and events, elements in BPMN do follow a certain naming convention, in order to understand them quickly and intuitively.

XOR gateways and in particular gateways which handle results / conditions in a process, do also have naming conventions. These are:

  1. Exclusive gateways should be labeled with a question.
  2. The outgoing conditions (sequence flows) need to be labeled with the answer to the question.
  3. All outgoing conditions need to exclude each other (e.g. yes/no).
  4. Merging Gateways are never labeled.

Select each figure for more information.

Naming Convention for XOR Gateways Test

Select each level in the figure for more information.

Key Takeaways - XOR Gateways

The Parallel Gateway (AND)

Today, the majority of business processes include multiple tasks, which are executed independently of each other by different departments / people. The process can only continue past a certain point after certain tasks have been executed. To model such a behavior in processes, we can use the parallel gateway (also called "AND" gateway).

Executing Tasks Independently of Each Other

In the previous example we didn't have a choice of selecting and eating multiple dishes at the same time. What do we actually do when we want a salad as a side dish?

Let's add a parallel gateway to our process to ensure we can eat a salad AND a steak.

With the usage of the AND gateway, there are some considerations:

  1. AND-Split: We always have to prepare and eat both - there is no choice anymore
  2. AND-Join: We can only start eating after both have been prepared

Summarizing the Process Behavior

The following animation explains more in detail what happens technically in the process - with a focus on the parallel gateways.

AND-Split and AND-Join

Applying the Token Concept

AND Gateways - and their Impact on Cycle Times.

The process example provided shows the BPMN element (text) annotation on task, which we have used to document the execution time. Text annotations can be used at any time on any BPMN element to provide helpful hints / information - but they should be used rather rarely to not overload the process model.

However, after considering the individual time for execution as well as the parallel tasks, what's the total cycle time of the process?

How Long Does the Process Take from Start to End?

How Long Does the Process Take from Start to End?

Distributed Tasks by Multiple Resources

The number of resources conducting a process becomes crucial whenever tasks actually need to be executed in parallel. One person cannot perform multiple tasks at once, even if it has been modeled as such. The point is, when assigning parallel tasks to only one responsibility, the order of execution is not important. Let's use a more visual explanation:

Tim is acting alone:

  • The cycle time cannot be reduced, as Tim has to do everything alone in a sequential order.
  • Even if tasks are assigned in parallel, Tim cannot do both at the same time - but he can at least decide which task to start with.

Tim gets supported by Robert:

  • While Tim takes care the steak does not get burned, Robert prepares the salad in the meantime.
  • Both tasks need to be completed before they both can start eating together.
Note
Tasks connected to a parallel gateway don't have to start at the same time. The parallel gateway just ensures the connected tasks are executed independently of each other - and are also completed, before the process can be continued.

Select each level in the figure for more information.

Key Takeaways - Parallel Gateways (AND)

The Inclusive Gateway (OR)

Sometimes, business tasks require flexibility.

Imagine, you're working at a telecommunication provider, where the customer can add different products for an extra charge to the main contract for internet & phone. Those could be:

  • An internet security package
  • An additional router for a better Wi-Fi connection
  • An additional mobile hotspot to connect from anywhere

The business process should be designed in a way, that all of these options can be chosen and the related business tasks get executed, based on the chosen set of options. They can't be mandatory, as not every customer want to add all three options every time to the contract. They also can't be exclusive as different products can always be combined.

The Inclusive Gateway (also called OR Gateway) allows modeling situations described above. Or in more specific words: To model business scenarios, where different options can be combined while ensuring that at least one option has been chosen.

Note
Although the "o" in the gateway stands for OR, you can also think of "options". This way, it's easier to remember its usage (as OR can also be misinterpreted as XOR).

How Does the OR Gateway Work in Detail?

This gateway is the most flexible one, as it behaves as a mix of exclusive and parallel gateway.

On the splitting side, it can either trigger only one outgoing sequence flow (like an XOR) or multiple ones at the same time (like an AND) plus bringing the capability to also combine only a few of all possible conditions - or even all of them. This aspect of flexibility might be difficult to understand just by looking at the OR gateway in a process model - but it can be very helpful in certain scenarios to replace a set of nested XOR and AND gateways.

On the merging side, the OR gateway can either synchronize different tokens (like an AND) or just passes a token forward, if there are no others (like an XOR). The specialty is, it doesn't wait for tokens on ALL incoming sequence flows (as the AND does) but only for the ones which are actually on their way.

Hidden Complexity

Due to its capability of handling different options, the number of actual combinations is not visible in the process. Here is an example.

Knowledge Check

Shared Tasks - Depending on the Case

Optional Tasks

While for some processes, we know all the responsible roles and personas ahead of time, for other processes the responsible parties may vary depending on the situation.

Looking at the process below, we can say:

  • All members choose a meal together (although Tim makes sure they all come together as a main driver of this task).
  • Example Case A: They all agree on having pasta and salad. That needs to be prepared by Tim and Robert.
  • Example Case B: They all agree on having steak and salad. That needs to be prepared by Sarah and Robert.
  • Example Case C: They all agree on just having pasta. As a pasta expert, Tim takes care of cooking a delicious pasta meal for the group.
  • In the end, Tim makes sure that they all eat together.

Applying the Token Concept

The following video shows, how the tokens are created, based on a certain case (steak and salad).

Select each level in the figure for more information.

Key Takeaways - Inclusive Gateway

Knowledge Check

Knowledge Check

Knowledge Check

Well done! Now it's time to have a closer look at common mistakes in practice, which might occur when the wrong combination of Gateways have been used!

Avoiding Unintended Process Flows

Unintended process flows? How can this happen? As we've learned until this point how to control them via gateways? Well, if you always consider the rules for splitting paths, merging flows correctly, using gateways always pairwise and following the naming convention, then this shouldn't happen at all. But we are humans and learning by making mistakes is in our nature - especially when complex business processes need to be modeled. Fortunately, we can show you the most common pitfalls and how to avoid them.

The token concept helps us in analyzing incorrect process behavior and to correct process flows, so the tokens don't get stuck in the process.

Incorrect Process Flows

Deadlocks

Deadlocks can occur when a parallel merging gateway waits for multiple tokens to synchronize but at least one token doesn't exist. Sounds weird? Check the process example above to figure out how this can happen (by accident).

Explanation:

  • The parallel splitting gateway creates 2 tokens (green flow)
  • Token 1 traverses "prepare shipment" and arrives at the parallel merging gateway (to get synchronized)Token 2 traverses "check customer status", "offer premium membership" and arrives at the parallel merging gateway (to get synchronized)

Problem: The parallel merging gateway expects a third token (red flow) as it always awaits a token on every incoming sequence flow. Unfortunately, this token doesn't exist - so the process gets stuck at this point (Deadlock).

Add the missing XOR Join.

To fix the problem, we just need to add the missing exclusive gateway to join the 2 sequence flows into one.

Multiple Task Execution

Multi Merges

Multi merges are not necessarily an error in terms of BPMN - but in most cases they create an unintended process behavior. They can occur when multiple tokens are not synchronized (to one) - or in other words: If a parallel merging gateway is missing.

Explanation:

  • The parallel splitting gateway creates 2 tokens (green flow)
  • Token 1 traverses "prepare shipment" and arrives at the exclusive merging gateway - and gets forwarded to "send order"Token 2 traverses "check customer status", "offer premium membership" and arrives at the exclusive merging gateway - and gets forwarded to "send order"

Problem: Without synchronizing the tokens created by the parallel split, the task "send order" is executed twice, and they also reach the end event twice.

Add the missing AND Join

To fix the problem, we just need to add the missing parallel gateway to synchronize the 2 tokens in the process into one, which gets forwarded to finally send the order.

Note
The Graphical Editor in SAP Signavio Process Manager checks automatically, if your process contains a deadlock or a multi merge and also shows exactly at which place in your process it is.

Knowledge Check

Knowledge Check

Modeling Exercise - Order Processing (Part 1)

This is an active process modeling exercise, to be done in SAP Signavio Process Manager. You may own already a license and can start immediately. If not, you can also register for a 30-day trial version for free and start in 3 minutes.

However, all three modeling exercises in the course are completely optional but give you the chance to apply your knowledge and also get familiar with the Graphical Editor of the SAP Signavio Process Manager!

Check out the eLearning course SIG120 Introduction to SAP Signavio Process Manager if not done yet, to have all necessary skills for completing the exercises with the Graphical Editor.

Feel free to register for a 30-day trial version and explore the SAP Signavio Process Manager. No credit card / payment required. Link: Register

Background

MyStore Inc. is a medium-sized mail order company. Due to the growing number of orders, the management has decided to document the business process of stock-to-delivery. Among other reasons, they also expect an improvement of onboarding new employees by providing transparent knowledge about internal processes.

If MyStore Inc. receives an order, an employee from the order acceptance team first enters the order data. The customer receives an order confirmation afterwards. An employee from the warehouse team then checks the delivery priority for the order.

If the customer has a premium status, the goods will be prepared for express shipment, otherwise for regular standard shipment.

While all preparations for the shipment are being made, the invoice will be created by the order acceptance team. Finally, the invoice is send to the customer by the order acceptance team and the order gets shipped by the warehouse team.

Assignment

  • Transform the "order processing" description into a compliant BPMN 2.0 model.
  • Please only use the elements you have already learned and model the perspective of the MyStore Inc. There is no need to include external process participants yet.
  • Estimated time effort: ~ 45 min

Modeling Tips

If you think you are done, check your solution again for syntax, semantics and naming convention issues. Also think about a user-friendly / readable look and feel for your diagram.

Note
There are different solutions for this exercise. However, you should have covered the same subject matters. Of course, the names of individual elements and the overall design may differ slightly.

When you are ready, view the sample solution and compare it with your own.

Log in to track your progress & complete quizzes