giggs11
giggs11

Reputation: 31

How to force completion of a parallel activity or workflow?

I've got a Windows Workflow (sequential) which contains just a single parallel activity, and within the parallel activity there are multiple sequence activities. The way the parallel activity works, all sequences must complete before the parallel activity is completed. I'm looking for something slightly different though... one of these sequences is unique, and when this particular sequence is completed I want to move on (complete the parallel activity) without waiting for the other sequences to complete). Since this workflow contains just this parallel activity, I need to either find a way to complete the parallel activity or complete the entire workflow. Either will get the result I'm looking for.

Is there a good way to handle this? Note, I'm using windows workflow foundation v3.5.

Upvotes: 3

Views: 1713

Answers (1)

Dave Cliffe - MSFT
Dave Cliffe - MSFT

Reputation: 66

The best way to handle this is probably by using a CAG: http://msdn.microsoft.com/en-us/library/ms733611(v=VS.85).aspx. You can specify a condition there that can be evaluated and determine whether or not the particular branch should complete the parallel.

In WF4, we tried to improve this scenario by having this behavior directly configurable via the Parallel activity via a CompletionCondition: http://msdn.microsoft.com/en-us/library/system.activities.statements.parallel.completioncondition.aspx. That won't be helpful to you with WF3.5, unfortunately, but hopefully it provides some context. :-)

-- Dave, WF Team

Upvotes: 4

Related Questions