Java Delegate
If your class implements theorg.camunda.bpm.engine.delegate.JavaDelegate interface, you can access the BPMN model instance
and the current flow element. In the following example the JavaDelegate was added to a service task in the BPMN model.
Therefore the returned flow element can be cast to a ServiceTask.
Execution Listener
If your class implements theorg.camunda.bpm.engine.delegate.ExecutionListener interface, you can access the BPMN model instance
and the current flow element. As an Execution Listener can be added to several elements like process, events, tasks, gateways
and sequence flows, it can not be guaranteed which type the flow element will be.
Task Listener
If your class implements theorg.camunda.bpm.engine.delegate.TaskListener interface, you can access the BPMN model instance
and the current user task since a Task Listener can only be added to a user task.