Skip to main content

Event-based Gateway

An event-based gateway allows to make a decision based on events.

workflow

An event-based gateway must have at least two outgoing sequence flows. Each sequence flow must to be connected to an intermediate catch event of type timer or message.

When an event-based gateway is entered then the workflow instance waits at the gateway until one of the events is triggered. When the first event is triggered then the outgoing sequence flow of this event is taken. No other events of the gateway can be triggered afterward.

Additional Resources​

XML representation

An event-based gateway with two outgoing sequence flows:

<bpmn:eventBasedGateway id="gateway" />

<bpmn:sequenceFlow id="s1" sourceRef="gateway" targetRef="payment-details-updated" />

<bpmn:intermediateCatchEvent id="payment-details-updated"
name="Payment Details Updated">
<bpmn:messageEventDefinition messageRef="message-payment-details-updated" />
</bpmn:intermediateCatchEvent>

<bpmn:sequenceFlow id="s2" sourceRef="gateway" targetRef="wait-one-hour" />

<bpmn:intermediateCatchEvent id="wait-one-hour" name="1 hour">
<bpmn:timerEventDefinition>
<bpmn:timeDuration>PT1H</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>

Using the BPMN modeler

Adding an event-based gateway with two outgoing sequence flows:

event-based-gateway

Workflow Lifecycle

Workflow instance records of an event-based gateway:

IntentElement IdElement Type
ELEMENT_ACTIVATINGgatewayEVENT_BASED_GATEWAY
ELEMENT_ACTIVATEDgatewayEVENT_BASED_GATEWAY
.........
EVENT_OCCURREDgatewayEVENT_BASED_GATEWAY
ELEMENT_COMPLETINGgatewayEVENT_BASED_GATEWAY
ELEMENT_COMPLETEDgatewayEVENT_BASED_GATEWAY
ELEMENT_ACTIVATINGpayment-details-updatedINTERMEDIATE_CATCH_EVENT

References: