How to assign the multiple actors to the task ?

1
0
-1

Hello,
I created a call activity and send multiple users can take the task.
I created actor filter with actor list using by the following source.
https://community.bonitasoft.com/project/actor-filter-user-list

This is my previous question.
https://community.bonitasoft.com/node/31485#node-31486

The user list works well. however, I faced another issue. The task did not assign all users of the returned list. So, once each user selects the task, The message "To fill out the form, you need to take this task. This means you will be the only one able to do it. To make it available to the team again, release it. " comes out.

I need to assign the task for all users of the returned users. Do you have any idea?
Thanks in advanced.

1 answer

1
+1
-1
This one is the BEST answer!

I think there is a little misunderstanding: one task instance can only be assigned to one user. One task instances can have a list of candidates but only one user can takes (i.e. claims) and do (i.e. submit) the task. You can read the blog post I published recently to learn more about actors and actor filters.

So if you want to have a similar task that should be done by each user in a list you might rather want to use a multi-instantiated task. You can refer to the documentation about Iteration to learn about how to configure multi-instantiated task.

Comments

Submitted by donghee.baik on Wed, 04/10/2019 - 16:19

Thanks for your recommendation. I think I need to change the logic.
I already use iteration to send data to other called activities. I thought once I send the list of users (specific users selected by the previous task), all users can assign the called activity.
I need to assign one user to send each call activities.
Thanks a lot.

Submitted by donghee.baik on Wed, 04/10/2019 - 19:40

I got the answer, As you recommended, I get the group Ids from lteration, then get approval list
and assign each approval to the next task.

Thanks a lot.

Submitted by jagch on Thu, 04/11/2019 - 14:40

Hi donghee.baik, antoine.mottier. Right now I am with the same problem that you presented.
I have no doubt that I must use parallel interaction to create multiple instances of tasks for different users. What is not is how to assign the task to each user.

My problem is that the task sends an email with an url access to the form directly but if the task is not assigned to a user it gives an error.

What I need is for a "revision" task to be sent to specific users and when the first one answers the task, cancel all the others and continue with the process.

I think the solution can be trivial since this type of modeling is common.

At the beginning I defined the bpm with a parallel input AND connector, two equal tasks assigned to two different users and ending with an XOR connector. But this does not work. After answering one task, do not cancel the other.

You have some idea of how to do it or if you could solve it in some way.

Thanks in advance

Juan

Submitted by antoine.mottier on Tue, 04/16/2019 - 07:37

The easiest solution would have been to:

  • define a single task
  • configure an actor or actor filter to define the list of candidates for the unique task instance
  • send an email with the tasks list link to each candidates . It should be unique email connector with a list of email address build with the following script: apiAccessor.processAPI.getPossibleUsersOfPendingHumanTask(activityInstanceId, 0, 100).collect{apiAccessor.identityAPI.getUserContactData(it.id, false).email}.join(', ')
  • let one of the user claim (take) the task. This action preventing other users from doing the task.

But has you discovered and as documented (see on the documentation page the important note), if you provide a direct link to the task to each users when they view the task form they will not be able to submit it as none of them actually claim the task. Claiming the task is mandatory to be able to submit the task.

In order to allow the user to claim the task a solution is to add a button widget, configured to perform a PUT action, using the ../API/bpm/humanTask/{{taskId}} URL and with the "data to send on click" set to {"assigned_id": session.user_id} where session is a variable initialized with a REST API call to ../API/system/session/unusedid This button will trigger the same API call as performed by the Bonita Portal when the user click on the "take" button.

Let me know if this solution works for you.

Notifications