The above configuration can be used in combination with an embedded process engine. If you want to use this feature in
combination with the shared process engine in a multi application environment, you need to add the
CdiEventListener
as process application event listener. See next section.@Observes-annotation. Event notification is type-safe. The type of process events is org.camunda.bpm.engine.cdi.BusinessProcessEvent.
The following is an example of a simple event observer method:
-
@BusinessProcessDefinition: restricts the set of events to a certain process definition. Example: -
@StartActivity: restricts the set of events by a certain activity. For example:is invoked whenever an activity with the id “shipGoods” is entered. -
@EndActivity: restricts the set of events by a certain activity. The following method is invoked whenever an activity with the id “shipGoods” is left: -
@TakeTransition: restricts the set of events by a certain transition. -
@CreateTask: restricts the set of events by a certain task. The following is invoked whenever a task with the definition key (id in BPMN XML) “approveRegistration” is created: -
@AssignTask: restricts the set of events by a certain task. The following is invoked whenever a task with the definition key (id in BPMN XML) “approveRegistration” is assigned: -
@CompleteTask: restricts the set of events by a certain task. The following is invoked whenever a task with the definition key (id in BPMN XML) “approveRegistration” is completed: -
@DeleteTask: restricts the set of events by a certain task. The following is invoked whenever a task with the definition key (id in BPMN XML) “approveRegistration” is deleted:
BusinessProcessEvent.getTask will return an instance of DelegateTask (in case the event is a task event).
If the listener is invoked after the transaction has completed, the DelegateTask object cannot be used for modifying variables.