How to implement reject in parallel approval workflow?

Posted by Dmitry Martynov on Stack Overflow See other posts from Stack Overflow or by Dmitry Martynov
Published on 2009-01-21T12:41:08Z Indexed on 2010/03/26 18:43 UTC
Read the original article Hit count: 471

I develop a SharePoint workflow with a Replicator activity to replicate a custom activity for every approver. The custom activity implements an approval branch for a particular user. It has classic form with CreateTask, While, OnTaskChanged and CompleteTask activities.

I setup UntilCondition on the replicator to cancel execution after one approver chooses to reject the approval and then workflow finishes. The problem happens with other uncompleted tasks which "hang" in their current state. User does not see this state when open the task.

I put UpdateAllTasks after the replacator to set the task status to Cancelled. But since there is no event activities between CompleteTask (for the rejected task) and UpdateAllTasks, the UpdateAllTask activity set Cancelled for the rejected task also.

The question, what can I do to flush the pending change made by CompleteTask before UpdateAllTasks?

Or perhaps, there is another way to implement such workflow. I was thinking about the way to implement Cancel handler for the custom activity with UpdateTask. But I do not know how to implement it and tell to the cancel handler that it executes in the case of the rejection.

© Stack Overflow or respective owner

Related posts about moss

Related posts about sharepoint