ParallelActivity Class
Runs a set of child activities at the same time. This class cannot be inherited.
Assembly: System.Workflow.Activities (in System.Workflow.Activities.dll)
'Declaration <ToolboxBitmapAttribute(GetType(ParallelActivity), "Resources.Parallel.png")> _ <WorkflowDebuggerSteppingAttribute(WorkflowDebuggerSteppingOption.Concurrent)> _ Public NotInheritable Class ParallelActivity _ Inherits CompositeActivity _ Implements IActivityEventListener(Of ActivityExecutionStatusChangedEventArgs) 'Usage Dim instance As ParallelActivity
The order in which child activities are run is non-deterministic.
The ParallelActivity is a CompositeActivity, which means the ParallelActivity can contain other activities. The SequenceActivity activity is the only activity that can be the child of a ParallelActivity.
Only one activity can run at a time.
The ParallelActivity only finishes when all children are complete.
The ParallelActivity is especially useful when there are one or more blocking activities, such as the DelayActivity activity, in one or more of the branches. In this scenario, the ParallelActivity actually switches to a different branch when the DelayActivity is blocked. If there are no blocking activities in any one of the ParallelActivity branches then the activity uses a non-deterministic sequence.
The following code example shows how to create a new instance of the ParallelActivity class, add the ParallelActivity class to the WhileActivity class, and add two SequenceActivity classes to the ParallelActivity class. This code example is part of the WhileAndParallel SDK sample from the WhileAndParallelWorkflow.Designer.cs file. For more information, see Using While and Parallel.
System.Workflow.ComponentModel.DependencyObject
System.Workflow.ComponentModel.Activity
System.Workflow.ComponentModel.CompositeActivity
System.Workflow.Activities.ParallelActivity
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.