cancel
Showing results for 
Search instead for 
Did you mean: 

assign task in round robin - is it out of the box in activiti 5.22 or the latest activiti 6?

vyssrayudu
Champ in-the-making
Champ in-the-making

Currently we are using activiti 5.22 and one of our clients asked to have "round robin task assignment". Is it available out of the box in 5.22 or in activiti 6 with less code?

- I saw multiple questions on the same but not with clear answer (some were in 2015 where it tells this is not out of the box)

- If round robin is already there in activiti 6 - what other task assignment styles (like fifo/lifo/any other) that Activiti 6 supports out of the box.

Appreciate your quick assistance. Thanks!

3 REPLIES 3

ryandawson
Elite Collaborator
Elite Collaborator

I don't think it's available out of the box in either, it's something you would need to write some code for. See for example Assign User Task a Round Robin mode or Can we assign task to users in round robin fashion depending upon location of user and form location... 

I presume the point is to ensure that each user (or perhaps user in a certain group) gets roughly the same number of tasks assigned. To do this you could keep a record of the last user to be assigned a task and each time a new task is to be assigned then you pick the next user in order of ID until there are no users with a greater ID and then you start at the beginning again. Or you could feasibly choose a user at random from the group as on average random selection should be evenly distributed (though one would have to be careful to use the pseudo-random number generator in a way that ensures distribution is indeed even). It is a similar problem to Help | Training | Salesforce  except that example is about distributing an existing pool of tasks, whereas you'd just need to allocate tasks out as they come. (Though I think you could do something closer to that example by using process instance id as they use 'lead number' and having a mapping of numbers to users.)

One could have a group as the candidate for a task so that anyone from the group can pick up those tasks and assign them to themselves but presumably the client doesn't want that in this case - maybe they want to ensure that everyone gets the same workload.

Thanks Ryan..yes ur assumption is right - client wanted to assign tasks to all agents evenly (max 10 per guy). 

So my second qn was - does activities support any task assignment modes out of the box - looks the answer is no as per ur thread.

No there aren't out of the box implementations of other assignment modes but there are examples available online that demonstrate setting assignee dynamically. For example a recent article in which this is done is - How to create Activiti Parallel Tasks with Spring JPA + Spring Boot Example - JavaSampleApproach . You can also look in the engine tests e.g. Activiti/CustomTaskAssignmentTest.java at develop · Activiti/Activiti · GitHub