Assign a Task to one or more Users

Hi Guys,

I have a requirement to assign a task to set of one or more users and every user must have the ability to accept the task and to work with the task. Only after all assigned users have finished her work the task is completed.

I can assign mutiple users to an task, but the Problem is, when the first user accept the Task the other users cannot accept the task too.

Have anyone an idea to handle this requirement?

Regards
Mario

hi Mario

When an user opens a task to work on it, do not accept the task. i.e., disable auto accept on open and auto accept on modification
When the uses completes his work, if there is a need to update task data - you can use below line of code to achieve it

get<TaskName>().applyChangesNoAccept();

When the last user completes his work, you can call completeTask() - which accepts and completes the task

HTH
Mervin

Hello Mervin,

thanks for your reply, this is great.

Do you have further an idea to identify the last user, because I can have n users.

Regards
Mario

Hi Mario,

You can get that from task info. If you provide more details about your requirements, it would be easier to determine better solutionā€¦

Hi Mervin,

I would like to provide a view more details:

  • There is one Task.

(The Task will be initiated by an Portlet where an user can choose a set of approvers wich will be assigned to the Task.)

  • It is required to assigne one ore more users to this task.
  • Each assigned user can make a disicion. (To agree or to not agree by clicking on a button)
  • After the last user finished the requester will get the conclusion of all decisions.

I hope this gives you a better overview.

Regrads
Mario

One way to achieve this is, you could maintain the decision of the users in task business data. Inside a document list you can maintain user name and decision (approve/reject) fields.
Also create fields for ā€˜number of approversā€™ and ā€˜no of completed approversā€™ etc (also ā€˜last approverā€™ field , which you said is required).

You can update these business data fields whenever an user acts on the task. When ā€˜number of approversā€™ ==ā€˜no of completed approversā€™, you can complete the task.

HTH
Mervin

1 Like

Hi Guys,
Itā€™s really interesting discussion. And in this area Iā€™m curious about your opinion as to whether the scenario described by Mario, may be implemented with Collaboration Tasks? Requester starts ParentTask and then requester creates n Child Tasks. Each ChildTask is assigned to given user. When users completes their ChildTask, requester can view results of each ChildTask and completes ParentTask. What do you think ? In advance, thanks for the feedback:)

Regards,
Slawek

Hi Guys,

thanks for all your answers. I have solved this issue based of the last answer of Mervin. So Iā€™ve created to Serices. One to creat a List with the people that have make a dicision and an other that will compare this list with the initial list of approvers and when both lists are equal the Task will copleted.

@Slawak: for further work I will try to use the collaboration Task :wink:

Regards
Mario