Transactions
Understand Asynchronous Continuations
To understand how asynchronous continuations work, we first need to understand how an activity is executed:
The above illustration shows how a regular activity which is entered and left by a sequence flow is executed:
The “TAKE” listeners are invoked on the sequence flow entering the activity.
The “START” listeners are invoked on the activity itself.
The behavior of the activity is executed: the actual behavior depends on the type of the activity: in case of a
Service Task
the behavior consists of invoking Delegation Code, in case of aUser Task
, the behavior consists of creating aTask
instance in the task list etc…The “END” listeners are invoked on the activity.
The “TAKE” listeners of the outgoing sequence flow are invoked.
Asynchronous Continuations allow putting break points between the execution of the sequence flows and the execution of the activity:
The above illustration shows where the different types of asynchronous continuations break the execution flow:
An asynchronous continuation BEFORE an activity breaks the execution flow between the invocation of the incoming sequence flow’s TAKE listeners and the execution of the activity’s START listeners.
An asynchronous continuation AFTER an activity breaks the execution flow between the invocation of the activity’s END listeners and the outgoing sequence flow’s TAKE listeners.
Asynchronous continuations directly relate to transaction boundaries: putting an asynchronous continuation before or after an activity creates a transaction boundary before or after the activity:
What’s more, asynchronous continuations are always executed by the Job Executor.
Last updated