Skip to main content

Gateways

Icons

All gateway icons are presented in the shape of a diamond.

Gateways_image1.png

Function

Gateways control the path that process Triggers should follow within the process.

Key Points

Classification

  • Based on the subsequent branch logic, gateways can be divided into:

    • Exclusive Gateways

      When a Trigger reaches an Exclusive Gateway, it can only flow towards the first subsequent branch that meets the condition.

    • Inclusive Gateways

      When a Trigger reaches an Inclusive Gateway, it generates multiple sub-Triggers flowing towards all subsequent branches that meet the condition. To converge these sub-Triggers, a Synchronizing Gateway is required.

    • Synchronizing Gateways

      After converging all sub-Triggers, the original Trigger continues to flow backwards. It is used to converge multiple branches of an Inclusive Gateway and process forks.

  • Based on the working mechanism, they can be divided into:

    • Probability Gateways

      When a Trigger reaches a Probability Gateway, it selects one of the subsequent branches for execution based on probability sampling.

    • Conditional Gateways

      When a Trigger reaches a Conditional Gateway, it selects the subsequent branch based on the result of a condition computation.

    • Trigger Filter Gateways

      When a Trigger arrives at a Trigger Filter Gateway, it periodically filters the incoming Triggers to determine the next branch for execution.

  • A specific gateway is described using a format: "Mechanism-Logic-Gateway," such as "Probability-Exclusive-Gateway" or "Condition-Inclusive-Gateway."

Compute Before or After Action

Gateways_image2.png

  • The computations before action are triggered by incoming Triggers, while the computations after actions are triggered by outgoing Triggers.
  • For example, if a Trigger flows through an Inclusive Gateway with five subsequent branches and all branch execution conditions are met, the computations will be performed once before the action and five times after the action.

Data Output

There is no data output from Gateways.

Gateway Settings

The settings for gateways include type selection and specific settings for each type.

Type selection

Type selection on the properties panel is as follows. See below for detailed settings.

Gateways_image3.png

Probability Exclusive Gateways

Gateways_image4.png

  • Function

    Based on probability, it selects which subsequent branch the Trigger will flow towards.

  • Detailed settings for exclusive probability gateway on the properties panel.

    Gateways_image5.png

    • Branch Probability

      Once subsequent components are connected to a gateway by Sequence Connectors, a subsequent branch probability table will appear on the gateway's properties panel. Each row in this table represents a subsequent branch. The first column shows the names of the subsequent components. The second column lets you define the probability of the corresponding subsequent branch, accepting expressions that return a Number type.

    • Other settings are universal and not discussed here.

  • Working Mechanism

    • Each time it is triggered, it selects which subsequent branch to follow based on probability sampling.
    • The system automatically computes the probabilities, ensuring that the sum of the probabilities for each branch equals 100%. Thus, the settings in the above figure imply a 50% probability for each branch.
Model Example

In a model that runs up to 100 Ticks, Pa represents the probability that the Trigger will follow the a+1 branch. Conversely, the probability of following the b+1 branch is 1-Pa. By adjusting the control slider at the top to modify Pa, you can observe the impact on the model's results.

Conditional Exclusive Gateways

Gateways_image6.png

  • Function

    Selects which subsequent branch the Trigger will flow towards based on custom conditions. It is equivalent to if...else if...else.

  • Detailed settings for Exclusive Conditional Gateway on the properties panel as below.

    Gateways_image7.png

  • Setting Methods

    • Create Condition

      Click the Add Condition Button to add a row for condition expression input box. Multiple input boxes are named as if, else if, else if, ..., and else, in sequence.

    • Input Condition Expressions

      This should return a Bool value. The final else condition does not require input.

    • Select the Subsequent Branch

      In the goto dropdown menu corresponding to the condition, select the branch that is already connected by the Sequence Connector or disable it.

    • Other settings are common and therefore omitted.

  • Working mechanism

    • When the gateway is triggered, it calculates the condition expression in order from top to bottom. Once it returns True, the Trigger immediately flows towards the corresponding branch. If all condition expressions return False, it goes to the else branch.
    • If the subsequent branch is selected as disabled and the condition judgment Trigger should follow this branch, a runtime error will be reported.
Model Example

The model evaluates the Result by examining the Score value. Feel free to tweak the Score variable controller and rerun the model to see changes in the Result.

Synchronizing Gateways

Gateways_image8.png

  • Function

    A Synchronizing Gateway merges the sub-Triggers from each branch that has been forked in the process fork. These sub-Triggers could be produced by process parallel forks or an inclusive gateway. After merging, the original Trigger before the branching is restored to continue the flow.

  • The properties panel for a Synchronizing Gateway is as follows. No settings are required.

    Gateways_image9.png

Model Example

The active start event generates a Trigger that, due to parallel forks, creates two sub-Triggers. Each initiates a +1 operation on the variable Count, resulting in a final value of 2. After the synchronizing gateway converges, the original Trigger continues to flow backwards.

Trigger Filter Gateways

Gateways_image10.png

  • Function

    Filters incoming Triggers periodically and lets the filtered Trigger flow towards a specified branch.

  • The properties panel for a Trigger Filter Gateway is as follows.

    Gateways_image11.png

  • Setting Methods

    • Start from Which Trigger

      Accepts a natural number, indicating from which Trigger to start filtering.

    • Every How Many Triggers

      Accepts a natural number, indicating the period of filtering out a Trigger.

    • Filtered Goes

      Select the branch connected by the Sequence Connector from the drop-down menu.

    • The Rest Goes

      Select the branch connected by the Sequence Connector from the drop-down menu.

Tip

The Trigger Filter Gateway can only have two subsequent branches - the filtered and non-filtered Trigger's subsequent branches.

  • Other settings are common and therefore omitted.
Tip

The filtering target is not the global Tick but the Trigger arriving at this gateway.

Model Example

Every 10 Triggers, 1 unit of resource x is added to the stock pool. This process repeats for a total of 100 ticks, resulting in 10 additions.