Setting activity destination users dynamically based on user order or level

  • 15 October 2008
  • 1 reply
  • 1 view

Badge +4

Hi,


I have a scenario where i am getting the destination users for an activity in an xml structure from the asp.net page along with the level of the users. now i need to send the task to the destination users according to their order. e.g say i get 4 users  User1 of Level 1, User2 of Level2, User3 of Level2, User4 of Level3.


Now i need to send the task to User1 first. When User1 finishes the task, then send the task to User2 and User3 simultaneously as they are on same level. once they are done with the task, send the task to user4.


Can somebody guide me how can I achieve this?


Regards,


Ritesh


1 reply

Badge +3

You could probably set up a loop iterating through the approval levels, selecting the users from a process xml field with XSLT and writing them back to another Process (or activity?) xml field.


 The client event would use the second process xml field that was updated with each iteration. 


 


To mock it out it would be -


ServerEvent A - Determine maximum number of approval levels.  Initialize the current Approval level


ServerEvent B - Use XSLT to select all of the approvers for the current approval level. 


K2.ProcessInstance.XmlFields["Approvers"].Value = currentApproversXmlDoc.ToString()


Client Event - Configure the Destination Users to be the Xml field Approvers


Server Event C - Increment Current Approval


Line Rule Back to Server Event A - Current Approval < Max Approval 


 


 

Reply