Configuring condition-based sequence flows

Sometimes, decisions in a process aren’t about probability — they’re based on specific rules or data, like property parameters. In a simulation, you can model these decisions by putting conditions directly on the outgoing sequence flows.

A condition is any XPath 1.0 expression that evaluates to true or false. At runtime, if the expression is true, the token follows that sequence flow; if it’s false, it won’t.

There are two types of conditions:

  • Self-contained

    These expressions don’t rely on any process data. They use only constants, operators, and functions.

    Example: 1 > 0 or “Approved” != “Rejected”.

  • Data-driven

    These expressions depend on property parameters defined in the process. At runtime, the condition evaluates the current property values to decide which path the token will take.

    Example: getProperty(‘amount’) > 1000.

    The result changes depending on the current values in your process. If the expression is true, the token follows that flow; if false, it doesn’t.

By using self-contained and data-driven conditions, you can model both deterministic decisions and data-based decisions in your simulations.

Configure conditions on outgoing sequence flows

Let’s look at the sequence flows that exit the exclusive gateway How many candidates? after the technical interview. Each outgoing sequence flow represents a possible path: one for when there’s only one candidate left, and one for multiple candidates.

Earlier in this tutorial, we defined a process property called Candidate_number to track how many candidates are still active. We can now use that property to write conditions for the outgoing flows.

In this scenario, the company simulates two possible outcomes:

  • If there’s only one candidate left, the process continues along the One candidate path.

  • If there are multiple candidates, the process continues along the Multiple candidates path.

To configure the conditions:

  1. Select an outgoing sequence flow from the How many candidates? exclusive gateway.

  2. In the Parameters panel that opens, in Condition, click and select Add default value.

  3. To set the conditions, click the current setting.

  4. In the dialog box that opens, enter these XPath expressions for each sequence flow:

    When the simulation runs, it will evaluate the Candidate_number property and route the token based on the matching condition.

    Sequence flow Condition
    One candidate getProperty('Candidate_number') = 1
    Multiple candidates getProperty('Candidate_number') > 1

    An outgoing sequence flow from the How many candidates? gateway is selected, with the Parameters panel open, highlighting the Condition section and showing the Edit condition dialog box.

Set conditions for other sequence flows

Now that you’ve configured conditions for one set of outgoing sequence flows, use the same steps to assign conditions for the sequences flows that exit the Prepare revised offer exclusive gateway. This decision point routes tokens based on the salary offer value:

Sequence flow Condition
Offer >=2000 getProperty('Offer')>= 2000
Offer < 2000 getProperty('Offer')< 2000