chesterdocs

#Decide which path a gateway takes

Give every path out of an exclusive or inclusive gateway a condition, or mark one as the default; an event-based gateway takes no conditions at all.

A gateway splits a process into paths. What decides the path depends on the kind of gateway:

Gateway What decides Paths taken
Exclusive The first path whose condition is true Exactly one
Inclusive Every path whose condition is true One or more
Event-based Whichever following event happens first Exactly one
flowchart LR
    X{{"Exclusive / inclusive gateway"}} -->|"StartEvent_order.amount > 1000"| A["Review by finance"]
    X -->|"Activity_fetch.customer.isNew"| B["Send welcome pack"]
    X -->|"default"| C["Send invoice"]
    E{{"Event-based gateway"}} --> T(["Timer: 3 days"])
    E --> M(["Message: reply received"])

#Set a condition on a path

  1. Select a sequence flow that leaves an exclusive or inclusive gateway.
  2. Open the Condition group in the properties panel.
  3. Enter an expression that evaluates to true or false, for example StartEvent_order.amount > 1000. A value is always read through the id of the step that produced it. See Write an expression.

Any value that counts as true in JavaScript takes the path, not only true. An exclusive gateway checks its paths in the order they were drawn and takes the first match.

⚠️ If no condition is true and there is no default path, an exclusive gateway fails the step — and an inclusive gateway ends the whole instance with an error.

Every path out of the gateway needs a condition. A path without one is shown as an error on the gateway, and a process with an error cannot be deployed.

#Mark a default path

Choose default instead of an expression on one path. It is taken only when no other condition is true — on an inclusive gateway as well, where the other paths may otherwise run together. Mark at most one path as the default.

#Model an event-based gateway

An event-based gateway waits for the events that follow it; the first one to happen decides the path. Its paths therefore get no condition, and the properties panel offers none. Chester checks the gateway as you model it:

  • It needs at least two outgoing paths.
  • Each path must lead to a timer, message or signal intermediate event — not to a task, another gateway or an end event.
  • No path may carry a condition, not even default.
  • Each of those events may be reached only from the gateway, not by another path as well.
  • Two paths waiting for the same signal get a warning: only one of them can be taken.
  • Loops through an event-based gateway are not supported: if a path after the gateway leads back to it, the gateway is marked as an error and the process cannot be deployed.

When the process runs, the gateway waits on all of its events at once. The first event to happen continues on its path; the other events stop waiting, and a message event that registered a webhook removes it again. An event that arrives after the decision is ignored. In the instance view the gateway's events that lost show as interrupted.

An event-based gateway cannot be retried from the instance view. One of its events can be retried only while none of them has happened yet, or when it is the event that won and then failed. Such a retry waits for that event to happen again; the other events do not come back.