Skip to Content

Event Subprocess

An event subprocess lives inside a process (or another subprocess) and is triggered by an event while the parent scope is active. It is not connected to the main flow by sequence flows.

<subProcess triggeredByEvent="true" id="handleCancellation"> <startEvent id="espStart" isInterrupting="true"> <messageEventDefinition messageRef="OrderCancelled" /> </startEvent> <serviceTask id="cancelOrder" activiti:topic="cancelOrder" /> <endEvent id="espEnd" /> <sequenceFlow sourceRef="espStart" targetRef="cancelOrder" /> <sequenceFlow sourceRef="cancelOrder" targetRef="espEnd" /> </subProcess>

Trigger types

TriggerActivation
ErrorThrown synchronously by an error end event or failing task
EscalationThrown synchronously by an escalation throw/end event
MessageAsynchronous — activated when a matching message is delivered
SignalAsynchronous — activated when a matching signal is broadcast
TimerAsynchronous — activated when a scheduled timer fires

Interrupting vs. non-interrupting

Controlled by isInterrupting on the event subprocess start event:

ModeBehavior
isInterrupting="true" (default)Cancels all active tokens in the parent scope. No new tasks/timers/subscriptions from the parent are created. The ESP runs to completion, then the parent scope ends.
isInterrupting="false"Parent scope continues running in parallel with the event subprocess. Multiple non-interrupting ESPs can be active simultaneously.

Scoping

Event subprocess subscriptions are scoped to the process instance. When an interrupting ESP fires, the server cancels all pending side effects (tasks, timers, other subscriptions) belonging to the parent scope before activating the ESP’s elements.

Last updated on