How to assign a Human Task to multiple users

Hi Community
I have saved a list of user emails in my database. From the Process, i am retrieving these users and saving the values in an Process variable.
Now I want to assign a human task to all these users. The person who picks the task first and does it will close the task. Ohers may not interfere. 
But I need all the users to be able to see the tasks in Task List.
I have used a script like

import org.bonitasoft.engine.api.IdentityAPI;
import org.bonitasoft.engine.identity.User;

IdentityAPI identity = apiAccessor.getIdentityAPI();
User user = identity.getUserByUserName(newsaleshead);

return user.getId();


But the above script is for single user. I need to assign to multiple users. How do i achieve this ??

Thanks

Hi

Add all users in a group and assign human task to this group (general tab -> Actors).

Hi Dibyajit,

first of all we use the word "assign" for something else.

We say that a task is "available" for n candidates. Among these n candidates only one will be the assigned, the user that will do the task.

So you can create an actor filter that will return the n candidates.

Where is your problem? in actor filter creation?

Did you check this doc?

https://documentation.bonitasoft.com/bonita/2021.1/creating-an-actor-filter

cheers,

Enrico

Hi,

Maybe this Actor filter will help you: GitHub - Bonitasoft-Community/users-list-actorfilter: A Bonita Actor Filter letting you select specific users from the task actor

You just need to create a list of the ids of the users you want the task available and pass it to the actor filter. This way you can have a dynamic actor.

Hello
Thank you for your answer.

Unfortunately this is not possible. Because I have multiple search criteria . Based on search criteria , i am selecting users.
I dont want to create different groups as then I would need to create hundreds of groups.

for example, I have different set of users for each function. I have around 10 functions. Each function has 3 set of approvals.
Hence i would need to create 30 groups. It would be easier to save the information in database and retrieve the users based on search criteria and then assign to them directly.

 

Regards

Your criteria is weird but anyway did you think about application?

You can create application page and show any process to any user. Function can be added in application page.

Hello
My Problem is not related to the application page or the function criteria.
I dont know how to assign one human task to Multiple users using a Actor filter script.

Regards

Thank you enrico.
Yes you are right. I want the task to be available not assigned.


I will check the Documentation for creating actor filter. This is new for me.

Regards