Diese Dokumentation wurde archiviert und wird nicht länger gepflegt.


Derivative of Activity that is the base class for all activities that contain other activities. A CompositeActivity is responsible for managing the execution of its child activities.

Namespace: System.Workflow.ComponentModel
Assembly: System.Workflow.ComponentModel (in system.workflow.componentmodel.dll)

public class CompositeActivity : Activity
/** @attribute TypeDescriptionProviderAttribute(System.Workflow.ComponentModel.Serialization.CompositeActivityTypeDescriptorProvider) */ 
public class CompositeActivity extends Activity
public class CompositeActivity extends Activity
Nicht zutreffend.

A CompositeActivity manages the execution of its child activities using ActivityExecutionContext class methods and events defined on the Activity class. For example, a child activity is scheduled for execution using the ExecuteActivity of ActivityExecutionContext. A CompositeActivity activity can be notified when a child activity completes its execution by subscribing to the Closed event defined on Activity.

The workflow runtime enforces certain constraints on CompositeActivity execution, the most fundamental of which is that a CompositeActivity activity cannot move to the Closed state if any child activities are still in a Executing, Canceling, Compensating, or Faulting, state.

This example shows a simple CompositeActivity that executes its first child activity for execution. When the child activity moves to the Closed state, the composite activity is notified and then completes its execution.

public class HasOneChildActivity : CompositeActivity
    protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        Activity child = this.EnabledActivities[0];
        child.Closed += this.ChildClosed;

        return ActivityExecutionStatus.Executing;

    void ChildClosed(object sender, ActivityExecutionStatusChangedEventArgs e)
        e.Activity.Closed -= this.ChildClosed;
        ActivityExecutionContext executionContext = sender as ActivityExecutionContext;


         Abgeleitete Klassen

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Microsoft .NET Framework 3.0 wird unter Windows Vista, Microsoft Windows XP SP2 und Windows Server 2003 SP1 unterstützt.

.NET Framework

Unterstützt in: 3.0