I was wondering what the best is to complete a gateway branch? I have an approval form that sends out the form in parallel to help speed up the process. The problem is that the form needs all the people to approve for it to be able to be processed. So if one of the users rejects the request, I wish to complete all of the other gateway branches. I was imagining at first that I would need to write my own program using the Livecycle API but I was looking through the process management activities and thought maybe something could be done here.
Does any one have any suggestions?
There is nothing out of the box to do that. You will have to use the API
This is a fairly complex use case to implement too. Here's a pseudo-code on how you could this:
1- Make sure you have two routes (Approve, Reject) that come out of each user step in you Gateway (in the main process). That way you'll see Approve and Reject in the Workspace interface.
2- Create a subprocess that uses the TaskComplete event as a start point. This will catch the event every time someone complete a task.
3- Check the "SelectedRoute" property of the event to see if it was Approved or Rejected.
4- If Rejected then create a custom component using the API that completes all tasks for a particular processInstanceID. The processInstanceID comes as part of the TaskComplete event.
Thanks Jas. I will work my way through this a little bit. I might have jumped the gun and a custom component has already been written by my colleagues to terminate the tasks. But this seems to be the approach that they took as well.