cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic task allocation

lossril
Champ in-the-making
Champ in-the-making
Hello,
I'm considering the possibility of implementation of dynamic task allocation, e.g. user task candidates and assignees are set up at process instance startup(or even somewhere in the process instance) by process variables or any other info. Does anyone has any clues how it can be implemented? I don't see API way to do it/
3 REPLIES 3

vasile_dirla
Star Contributor
Star Contributor
Hi,
you could use some ExecutionListeners
http://www.activiti.org/userguide/#executionListeners

lossril
Champ in-the-making
Champ in-the-making
Well, I cannot find a way how to make people candidates for a task. Yes, it is easy to implement EventListener which will pop up when the task is created and will assign it to a person. But if I need to check which people are eligible for this exact task? For example, members of the group X are candidates for the task by process definition, but some input parameters(or environment data) on the creation of the task say "users A, B and C are on vacation, and E and F are ineligible for the current case" and we narrow the candidate list to users G, L and R.

I didn't find any way to change candidates of the task via API. Task API allows to set assignee and owner, but not the candidates. Changing candidate list manually or automatically(e. g. parsing and changing XML) and deploying the definition is a huge workaround imo and won't work for any real amount of workflow. I can think of creating generic groups on the fly, but this approach is a workaround and has its own loopholes and problems.

The possible solution is to set candidate list by UEL expression, but it isn't possible at the moment and I suppose it isn't a priority.

jbarrez
Star Contributor
Star Contributor
As Vasile, said, you can use a task listener on the 'create' event. In that task listener, you have a 'task' object, to which you can add 'identityLinks'. This way you can set candidates for the task.