Question

I have a workflow with a parallel activity, where one branch does work and the other has a receive activity that can shut the workflow down (is the proper way to do this with a HandleExternalEvent instead?). The problem, of course, is that if the receive activity is never called, the work branch completes and waits on the receive activity branch. How can I signal the other branch to close the activity? I've toyed a bit with using a listen activity to hold the receive activity and a custom event activity, but I'm missing something on how to make that work, as well.

Was it helpful?

Solution

You can use 'CompletionCondition", which is a parallel activity property that indicates whether parallel activity must finish if a branch ends.

You can check it here

OTHER TIPS

You could cancel the listening activity on the alternate branch using the CancelActivity method on the ActivityExecutionContext object:

http://msdn.microsoft.com/en-us/library/system.workflow.componentmodel.activityexecutioncontext.cancelactivity.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top