
Process Applications
Process Application Event Listeners
The process engine supports defining two types of event listeners: Task Event Listeners and Execution Event Listeners. Task Event listeners allow to react…
The process engine supports defining two types of event listeners: Task Event Listeners and Execution Event Listeners.
Task Event listeners allow to react to Task Events (Tasks are Created, Assigned, Completed). Execution Listeners allow to react to events fired as execution progresses through the diagram: Activities are Started, Ended and Transitions are being taken.
When using the process application API, the process engine makes sure that Events are delegated to the right process application. For example, assume there is a process application deployed as “invoice.war” which deploys a process definition named “invoice”. The invoice process has a task named “archive invoice”. The application “invoice.war” further provides a Java Class implementing the ExecutionListener interface and is configured to be invoked whenever the END event is fired on the “archive invoice” activity. The process engine makes sure that the event is delegated to the listener class located inside the process application:

On top of the Execution and Task Listeners which are explicitly configured in the BPMN 2.0 XML, the process application API supports defining a global ExecutionListener and a global TaskListener which are notified about all events happening in the processes deployed by a process application:
To use the global process application Event Listeners, you need to activate the corresponding Process Engine Plugin:
Note that the plugin is activated by default in the pre-packaged ASEE Flow distributions.
The process application Event Listener interface is also a good place for adding the CdiEventListener bridge if you want to use CDI Events in combination with the shared process engine.
