BPMN Gateways

Introduction

In BPMN 2.0, Gateways control the flow of processes by determining how sequence flows are split, merged, or directed based on certain conditions. They are decision points within a process where the path can diverge or converge, and they enable you to model complex workflows with multiple possible outcomes. Gateways are represented by diamond shapes in BPMN diagrams, with different icons inside to indicate their specific behavior.

Types of Gateways:

Exclusive GatewayExclusive Gateway
Inclusive GatewayInclusive Gateway
Parallel GatewayParallel Gateway
Event GatewayEvent Gateway

Exclusive Gateway (XOR Gateway)

Exclusive Gateway
  • Purpose: This is the most common type of gateway, where only one outgoing path is followed based on conditions.
  • Visual Representation: A diamond shape with an “X” inside.
  • Example: In an approval process, if the request is approved, it follows one path; if denied, it follows another.
  • Use Case: When the process can only take one path based on a decision, like “yes/no” or “true/false.”

Inclusive Gateway (OR Gateway)

Inclusive Gateway
  • Purpose: This gateway allows one or more paths to be followed based on conditions. All paths whose conditions evaluate as true are taken.
  • Visual Representation: A diamond shape with a circle inside.
  • Example: In a process where multiple approvals are needed (but not all), the system can follow all applicable approval paths based on set conditions.
  • Use Case: When multiple paths can be followed depending on conditions, such as multiple criteria that could trigger different actions.

Parallel Gateway (AND Gateway)

Parallel Gateway
  • Purpose: This gateway is used to split the flow into multiple parallel paths, where all branches must be followed simultaneously. It can also be used to synchronize multiple incoming paths.
  • Visual Representation: A diamond shape with a ”+” inside.
  • Example: A task where documents are reviewed by multiple departments at the same time.
  • Use Case: When tasks or actions need to occur in parallel or when multiple paths must be synchronized before continuing.

Event-Based Gateway

Event-Based Gateway
  • Purpose: This gateway directs the flow based on events that occur. It waits for a specific event (e.g., message, timer, signal) to determine which path to take.
  • Visual Representation: A diamond shape with a pentagon inside.
  • Example: A process that waits for either a customer response or a timeout to continue the flow.
  • Use Case: When the next step of a process depends on external events, like waiting for a message or a timer trigger.

Key Points about Gateways

  • Splitting Flows: Gateways can split a single sequence flow into multiple branches, determining which path (or paths) to follow based on conditions or events.
  • Merging Flows: Gateways can also merge multiple sequence flows into one, synchronizing parallel paths or converging based on specific conditions.
  • Decision-Making: Gateways are essential for modeling decision points, where the flow of the process depends on the outcome of evaluations, events, or user input.

Use Cases

  • Exclusive Gateway: When only one condition can be true, and the process needs to follow a single path.
  • Parallel Gateway: When multiple tasks can happen simultaneously, and all must be completed.
  • Inclusive Gateway: When one or more conditions can be true, and multiple paths need to be taken.
  • Event-Based Gateway: When the flow depends on external events, such as waiting for a message or timer.
  • Complex Gateway: When complex rules or conditions govern how the process continues.

Example

In a simple approval workflow:

  1. Exclusive Gateway: If the request is approved, the process proceeds; if rejected, it ends.
  2. Parallel Gateway: After approval, two tasks (document preparation and notification) can be completed in parallel.
  3. Event-Based Gateway: The process waits for either a customer reply or a timeout to determine the next step.

Gateways are critical for making business processes more flexible, allowing decision-making, parallel processing, and synchronization of different paths within the workflow.