I’m trying to assign a task to all users in a group but only the first who takes the task can actually do it, but what I need is ALL the users in that group to do the same task.
Thank you in advance.
I’m trying to assign a task to all users in a group but only the first who takes the task can actually do it, but what I need is ALL the users in that group to do the same task.
Thank you in advance.
Hello
You need to use Multi-instantiation tasks. You can assign same task to multiple users. Its like creating the same copy for all the users. But all users must do the task to complete the process, else it will still be pending with those who have not done the task.
To make sure the first person who takes the task, and it gets removed from other uers, there is something called EARLY COMPLETION CRITERIA.
use Multi-instantiation to address your scenario
reagrds
Hi,
I’m new to bonita so I’m sure I’m doing something wrong but I tried to do it using a list of users in a group:
String org_path = “/acme/test”;
Group gp=apiAccessor.getIdentityAPI().getGroupByPath(org_path);
final IdentityAPI identityAPI = TenantAPIAccessor.getIdentityAPI(apiSession);
final SearchOptionsBuilder builder = new SearchOptionsBuilder(0, 100);
builder.filter(UserSearchDescriptor.GROUP_ID, gp.id);
final SearchResult userResults = identityAPI(apiSession).searchUsers(builder.done());
Thank you for the help.
Hi,
I’m new to bonita so I’m sure I’m doing something wrong but I tried to do it using a list of users in a group:
String org_path = “/acme/test”;
Group gp=apiAccessor.getIdentityAPI().getGroupByPath(org_path);
final IdentityAPI identityAPI = TenantAPIAccessor.getIdentityAPI(apiSession);
final SearchOptionsBuilder builder = new SearchOptionsBuilder(0, 100);
builder.filter(UserSearchDescriptor.GROUP_ID, gp.id);
final SearchResult userResults = identityAPI(apiSession).searchUsers(builder.done());
Thank you for the help.
Hi
You got most of the Process Correct. You just need to make small changes to make it work.
Here is how I use Multi-Instantiation.
import org.bonitasoft.engine.api.IdentityAPI;
import org.bonitasoft.engine.identity.User;
IdentityAPI identity = apiAccessor.getIdentityAPI();
User user = identity.getUserByUserName(actor or Requesters);
return user.getId();
This should do it.
Let me know if you have issues. Share the BOS file with Bonita Version name and I will try to see if I can fix it for you.
Regards
Hi again,
I’ve tried to follow your steps but I still can’t make it work. The only thing I made different is the selection of the users: I’d like to select them using a script, that’s why I created a group and I was trying to select all users in that group. Here’s my BOS file (Bonita 7.5):
https://www.dropbox.com/s/hayejzwvozjiskq/Test-1.0.bos?dl=0
Hey Bro
You did everything correct. I just added a step before the Multi-instantiation and the Process is Working like a charm.
The link is https://www.dropbox.com/s/nqv53ib9sqdzk8v/Test-1.0.bos?dl=0
Download and run the Process. Let me know if any issues comes up.
Just note that I have removed the script from the Test Variable.
Step 1 has contract , form and Operations. Just check them out.
Regards
Hi,
It works but that’s not exactly what I was looking for. I wanted to assign the task to all the users in the group without selecting the users manually in the form. In other words, I wanted to initialize the list of users automatically from a script. Is it possible to do it without filling the form?
Thanks.
Yes, we can do load all the users from a group and assign the task directly to all of them.
But I dont have any examples right now. To do that, we need to experiment with identity API.
But the way I see, your problem with Multi-instantiation is solved. I hope you have a better understanding of the idea.
Now you have to find a solution to the Problem of using groovy script to load members from a Group and add them to the Process Variable. For this, you should raise a new question in the Community.
I am sure someone out there will have a solution for you.
Regards