Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between ExecutionListener and TaskListener

Tags:

camunda

As I have read:

In general, the task listener event cycle is contained between execution listener events:

ExecutionListener#start
TaskListener#create
TaskListener#{assignment}*
TaskListener#{complete, delete}
ExecutionListener#end

see complete list at Camunda BPMN - Task listener vs Execution listeners

But now I have this question: what is the difference between ExecutionListener#start and TaskListener#create, or as I noticed the create event has started after start event started, which business should I set in the start event and which one should I set in the create event? Or are there any problems if I put all of my business in the start event?

like image 235
AKZ Avatar asked Apr 16 '16 07:04

AKZ


1 Answers

I think the important difference to remember is that the ExecutionListener is available for all elements and allows access to the DelegateExecution, while the TaskListener only applies to tasks (bpmn and cmmn) and gives you access to the DelegateTask.

The DelegateTask is important for all task-lifecycle operations, like setting due date, assigning candidate groups, ... you just cannot do this with the DelegateExecution.

So in general, we use ExecutionListeners on events and gateways, JavaDelegates on ServiceTasks and TaskListeners on UserTasks.

like image 183
Jan Galinski Avatar answered Oct 23 '22 15:10

Jan Galinski