Process wide listener for every end/start event of a user task

614 views
Skip to first unread message

andreas.sp...@gmail.com

unread,
Mar 9, 2016, 8:37:02 AM3/9/16
to camunda BPM users
Hey everyone,

I've integrated camunda in one of our a backend applications some months ago and like it a lot.
But now we need to copy the assignee of a user task to all following user tasks in our processes.

A possible solution for that would be to store the assignee in a variable and use it in new user tasks via task listeners.
(That still can lead to problems when finishing tasks concurrently, but that is acceptable in this case)

But then I would have to add task listeners to all user tasks in our processes or to add the listeners to every user task programmatically before deploying the processes.

Are there any better solutions?

Ingo Richtsmeier

unread,
Mar 9, 2016, 8:56:13 AM3/9/16
to camunda BPM users, andreas.sp...@gmail.com
Hello Andreas,

two possible solutions: You can use an expression for the assignee in the user task: ${userIdVariable}

You can register the task listener in the process engine by a plugin (see: https://github.com/camunda/camunda-bpm-examples/tree/master/process-engine-plugin/bpmn-parse-listener for an example) The listener is now available for all user tasks from all process definitions. If you want to restrict the listeners to certain tasks, you have to check the actual task in the listener (and maybe do nothing).

Hope this helps,

Ingo

andreas.sp...@gmail.com

unread,
Mar 9, 2016, 9:39:06 AM3/9/16
to camunda BPM users, andreas.sp...@gmail.com
Hi Ingo,

thank you very much for your response!

I dont's like the first solution (task listener) that much because we'd have to add the scripts to every task in a process.

If nobody has another solution to solve this easier without adding listeners programmatically I'll do it like that.

Thanks for the plugin hint!
Andi

Philipp Ossler

unread,
Mar 9, 2016, 9:45:25 AM3/9/16
to camunda BPM users, andreas.sp...@gmail.com
Hi Andreas,

by the way, you may be interested in the Reactor community extension [1].

Greetings,
Philipp

Reply all
Reply to author
Forward
0 new messages