How to assign user task to next user at runTime

Hi All,
I have a BPM process flow where 4-5 user task is there.Now my requirment is to assign the task to next user-group at runTime.

Complete scenerio of the requirment…
User will login to the MWS(customized url) where they will fillup the business data in CAF UI form.After user submit BPM process will get started and will wait in user task for submit.
Now my requirment is when the BPM process will start it will assign the next task to one group(which is created in background using CDS library depending upon data provided by user in UI including group name eg: level1).Similarly when task1 is completed it will get assign to level2 group which is created dynamically.
Can some one please help me to know how can I can assign the task dynamically and from which step it to be assigned.

Thanks
Baharul Islam

If your task requires multiple level approval, and these levels are not fixed (changes dynamically for different instances), this looks like a use-case for ‘Collaboration task’. Have a look at this topic in ‘task engine users guide’…

HTH
Senthil

Hi Senthil,
Thanks for suggestion.
But for my case ,approval levels are not dynamic.Users or group to which task will be assigned is dynamic.

Thanks
Baharul Islam

I’m not sure, but you could create an action in the task which would be fired when the task is queued. In that action, you can assign the task to a group based on the tasks’s business data.

Anouther way would be to specify a rule set for the task step in the process model. But since the groups are created at runtime (and the rule set is created at design time) I’m not sure how the details of this approach would look like.

You have to try (and error :slight_smile:

Please report back if you have had any success!

Hi Baharul,

I have a question in order to understand better your situation: are the groups that you need to assign the task to created OR calculated at run-time. This is not clear for me.

My idea would be to use Task Events:

  • either create an onQueue task event like fml2 suggested above. In this event you might want to calculate the group and save the value to TaskInfo/assignedToList
  • or create an onComplete task event that calculates the group and sets it to the business data in a field like businessData/nextGroupToAssign. This means that you will need also an onQueue task event that will sync businessData/nextGroupToAssign with TaskInfo/assignedToList.

Please correct us if we did not understand the requirement correctly.

Hope it helps,
Vlad Turian

Thnaks Vlad for your suggestion.

Yes both group name and users in the group will be decided at run time or I can create all 4-5 group and users at the first level.

But I can’t get your point how to implement on onQueue Task event event that will sync businessData/nextGroupToAssign with TaskInfo/assignedToList.Can you please provide some details how to implement onQueue task.

Thanks
Baharul Islam

Hi Baharul,

The following resource offers a great help in dealing with task events: 8-2-SP1_BPM_Task_Development_Help.pdf (page 168 - “Working with Task Events”).

If you have questions do not hesitate to let us know.

Vlad Turian

Hi Vlad,

Thanks for your input.

I have tried with using event for user Task,but for my scenario this is not possible by using event.As I want to control next task assignment from previous task and there is no action type to control next task as well as no event type as task completion.

How ever I am able to complete my flow using some extra field in BusinessData(field like approverL1…approverL5) for storing groupID for each task to be assigned.And populating this groupIDs in businessData at very first level.And assigning task to group at design time to businessData filed(approverL1…approverL5).

Thanks
Baharul Islam

Hi Baharul,

I am glad you managed to find a solution.

Just wanted to say “On Complete” and “On Queue” task events really exist.

For example:

  • go in your task application
  • find the task folder
  • open taskDefinition.xml
  • go to the “Events” Tab
  • add a new event
  • in the event type dropdown you will see a lot of event types. Among them: “Completed” and “Queued” (see attachment)

Hope it helps,
Vlad Turian