Gateways split a workflow into several paths and join them again.
| Gateway | What it does |
|---|---|
| Exclusive Gateway (XOR) | Chooses one of its outgoing paths, by conditions. |
| Parallel Gateway | Runs all of its outgoing paths at the same time, or waits for all of its incoming paths. |
Exclusive Gateway
Section titled “Exclusive Gateway”Use an exclusive gateway when the process should go one way or another, for example to send a form back to the client when the agent rejects it.
To add one, drag Exclusive Gateway (XOR) from the palette, or click Append exclusive gateway on the element before it. Then connect its outgoing paths, and set up:
- the inputs of the gateway: the values the conditions check;
- a condition on each outgoing path;
- the default path, taken when no condition is met.
Gateway settings
Section titled “Gateway settings”| Tab | Setting | What to enter |
|---|---|---|
| General | Name | The name shown on the canvas (default: “ExclusiveGateway”). |
| General | Default Way | The outgoing path to take when no condition is met. Each path is shown as “path → next element”. Required. |
| Inputs | The values the conditions can check. Inputs from the elements before the gateway are added automatically. See Inputs and data. |
How the path is chosen
Section titled “How the path is chosen”When the process reaches the gateway, the conditions of the outgoing paths are checked one by one, and the process takes the first path whose condition is true. If no condition is true, the process takes the Default Way. If there is no default way, the process fails.
- A path without a condition is taken only if it’s the default way.
- If several conditions can be true at the same time, only one path is taken. Write conditions that exclude each other.
- If a condition can’t be evaluated, for example because of a JavaScript error, the process fails.
Add a condition to a path
Section titled “Add a condition to a path”Click the outgoing path (the arrow) on the canvas, and open the Condition tab. The tab is shown only for paths that leave an exclusive gateway.
Select the Expression Type:
- JavaScript Expression (the default): write the condition in JavaScript.
- Expression Builder: build the condition from rules, without code.
Changing the expression type clears the condition.
JavaScript expression
Section titled “JavaScript expression”Write a function body that returns true to take the path. Use the gateway’s inputs by their ID, for example:
return parameter1 === 'approved' && parameter2 > 1000;You can also use process values such as $id (process ID), $name (process name) and $businessKey. The editor suggests names as you type, and you can insert a value from Insert Variable.
Expression Builder
Section titled “Expression Builder”The Expression Builder checks the gateway’s inputs and the process values (Process ID, Process Name, Business Key and Initiator).
- Choose AND (all the rules must be true) or OR (one rule is enough) at the top of the group.
- Click Add Rule to add a rule: select the field, the operator and the value. You can select a part of a field, for example Form Data of a session result, or the Email of the initiator.
- Click Add Group to add a group of rules with its own AND/OR. Groups can be nested two levels deep.
The operators depend on the field’s type:
| Type | Operators |
|---|---|
| Number | equals, not equals, less than, less than or equal, greater than, greater than or equal, between, not between, is empty, is not empty, is null, is not null |
| Datetime | equals, not equals, less than, less than or equal, greater than, greater than or equal, between, not between, is null, is not null |
| Boolean | is true, is false, is null, is not null |
| All other types | equals, not equals, contains, does not contain, begins with, ends with, is empty, is not empty, is null, is not null |
If you change or remove an input that a rule uses, the rule shows a warning, for example “Select the field again”. Fix the rule before you save.
Validation
Section titled “Validation”The editor reports these problems under Validation Errors:
- a gateway without a Default Way;
- an Expression Builder rule without a field, with a field that is no longer an input of the gateway, or with an operator that doesn’t fit the field’s type;
- an input without a name or a source.
JavaScript conditions are not checked by the editor. Test them by starting a process.
Parallel Gateway
Section titled “Parallel Gateway”Use a parallel gateway to run several paths at the same time, for example to send forms to two signers at once.
- Split: when the process reaches a parallel gateway with several outgoing paths, all of them start.
- Join: a parallel gateway with several incoming paths waits until all of them reach it, and only then continues.
Add one gateway to open the parallel paths and another to close them, so the process waits for all the paths before it continues.
To add one, drag Parallel Gateway from the palette, or click Append parallel gateway on the element before it. Its only settings are the ID and the Name (default: “ParallelGateway”). Elements after the gateway can use the outputs of the elements before it.