BPMN Gateways

AND Gateway

BPMN Process

The AND split enables multiple parallel process flows that run concurrently by creating a new (sub-)token for every outgoing sequence flow.

The joining AND gateway waits for a token on every incoming sequence flow. It goes on if all tokens have arrived.

<bpmn:parallelGateway id="Gateway_12isvf1"></bpmn:parallelGateway>

<bpmn:sequenceFlow id="Flow_0m8ktb3" sourceRef="Gateway_12isvf1" targetRef="Gateway_0j4md5h" />
<bpmn:sequenceFlow id="Flow_0xnt74i" sourceRef="Gateway_12isvf1" targetRef="Gateway_0j4md5h" />
<bpmn:sequenceFlow id="Flow_1yhh5gm" sourceRef="Gateway_12isvf1" targetRef="Gateway_0j4md5h" />

<bpmn:parallelGateway id="Gateway_0j4md5h"></bpmn:parallelGateway>

XOR and OR Splitting Gateways

BPMN Process

The exclusive (XOR) and inclusive (OR) gateways for splitting a process flow are supported.

The conditions are part of the outgoing sequence flows inside a conditionExpression. The condition needs to be single-line JavaScript code (see Script Tasks) which evaluates to a boolean. On the engine, the code is taken and a return is put in front of it to get the result. An outgoing sequence flow is only allowed to have no condition, if the default attribute inside the gateway element is pointing to this sequence flow.

  • the attribute language is optional because the expressionLanguage attribute in the overall process should already point to JavaScript
  • the name of the sequence flow should give an explanation about the condition in natural language
<bpmn:exclusiveGateway id="Gateway_0sa28ep" name="Question?" default="Flow_06wcc11"></bpmn:exclusiveGateway>
<!-- OR -->
<bpmn:inclusiveGateway id="Gateway_0sa28ep" name="Question?" default="Flow_06wcc11"></bpmn:inclusiveGateway>

<bpmn:sequenceFlow id="Flow_16ilr5i" name="Path 1" sourceRef="Gateway_0sa28ep" targetRef="Gateway_0yeglea">
    <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">
        variable.get('cost') > 500

<bpmn:sequenceFlow id="Flow_0vwvh4d" name="Path 2" sourceRef="Gateway_0sa28ep" targetRef="Gateway_0yeglea">
    <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression" language="https://ecma-international.org/ecma-262/8.0/">
        variable.get('cost') == 200

<bpmn:sequenceFlow id="Flow_06wcc11" name="Default Flow" sourceRef="Gateway_0sa28ep" targetRef="Gateway_0yeglea" />

XOR Joining Gateways

BPMN Process

In the case of the XOR join, the gateway waits until one token arrives at an incoming sequence flow. Then it fowards the token to the outgoing sequence flow.

<bpmn:sequenceFlow id="Flow_0cndh90" sourceRef="StartEvent_1" targetRef="Gateway_0q0qwtl" />
<bpmn:sequenceFlow id="Flow_0x9fv5m" sourceRef="Event_0z8366y" targetRef="Gateway_0q0qwtl" />

<bpmn:exclusiveGateway id="Gateway_0q0qwtl"></bpmn:exclusiveGateway>

<bpmn:sequenceFlow id="Flow_1rz8t57" sourceRef="Gateway_0q0qwtl" targetRef="Event_1nmflnr" />

OR Joining Gateway not supported

The inclusive (OR) joining gateway is not yet supported.