Parallel approval in an IPC: PLEASE HELP!

  • 29 April 2008
  • 4 replies
  • 1 view

Badge +3

Hi 


I have a workflow for purchase orders that can be approved/escalated by any one of 3 people; The user, the requester and an andministrator. This is done in an ICP child process.


I have 3 FormEvents in the IPC child process that run in parallel with each other, each one of them sending out an approval request to one of the three users.


The idea is that if one users actions the purchase order and then the IPC event finishes and the parent process continues, however this is not working as the IPC event is not finishing until all three users have actioned the PO.


Is there a way of setting the IPC child event to 'completed' when 1 user actions the PO so that the parent process continues?


Any help much appreciated


Rich


4 replies

Badge +11
Is it the same client event for each of the users?  If so, you might want to consider doing this in one client event with one slot, but have three destinations.  That way, the first one who finishes completes the activity. 
Badge +3

Hi David


Thanks for the quick response. 


I need the emails to be worded differently depending on who it is going to. Also if it is escalated by the requester/admin then a seperate email needs to be sent out too to inform the approver they were skipped.


I think this means I need the 3 separete events


Rich

Badge +11

OK,so it looks like you really do need 3 activities.  The reason your IPC event isn't finishing is because the other client events are still waiting for user action.  Here's one way you could accomplish this.


Make all of your client events join at one activity somewhere down the line.  This activity will use the GotoActvity method to go to another activity that is the last step in your process.  You can draw a line from this activity to the last activity for documentation purposes even though you're using GOTO.  Why GOTO?  A side-effect of using GOTO is that it cancels all parallel paths in a process.  The first client activity that completes will work its way down to the activity containing the GOTO and that will take you to the last activity in the process, cancelling the other client events that are waiting for a response.


Don't use GOTO in place of line rules.  Used too much, it will make your process difficult to understand and maintain.  Use line rules to control the flow of your process; use GOTO when only when you want to cancel parallel paths, not to control flow.


PS--You can download from blackmarket a GOTO even wizard that you can add to your Visual Studio toolbox (I wrote it).  Or you can use K2.GotoActivity("acitivity") name in server event code.

Badge +3

Brilliant that worked, thanks David.

Reply