views:

1550

answers:

7

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.

A: 

Any luck with this yet? I'm having the same issue.

A: 

Did you try putting a code activity between the complete task and updatealltasks activity?

RKDMC
A: 

any luck with this? I am trying to accomplish same thing but can't do it..can you copy sample code here that would be greate help

5luck
A: 

Hi, Struct your activities as the following: Create Task - > OnTaskChanged -> If/Else Activity (set the condition true if the approver decision was "reject") -> (Inside the If branch) UpdateAllTasks Activity (set the status to cancel within the Activity properties) -> (Outside the If branch) CompleteTask Activity.

When an approver decides to reject a task, the WF will cancel all the tasks. It will also cancel the task of the person who rejected but right after the "CompleteTask" activity will fire and set the corresponding task as Completed.

Yoni Goldberg
A: 

Hi, Can anyone pls send me source code for this workflow. Thanks in advance. Sekhar My email id is: [email protected]

Sekhar
A: 

Hi yeni Goldberg, I have implemented my workflow, in the same way, which you have suggested. But, I could not set the until condition for the replicator acivity, if any one task has been rejected. How do i break the replicator activity execution, if any one of the tasks is rejected. Please help me. Thanks.

Sekhar
A: 

I am facing the same issue - sekhar did you get any solution to

I have implemented my workflow, in the same way, which you have suggested. But, I could not set the until condition for the replicator acivity, if any one task has been rejected. How do i break the replicator activity execution, if any one of the tasks is rejected. Please help me. Thanks.

Poonam