ActivityExecutionContext.ExecuteActivity(Activity) 方法

定义

由复合活动调用,用于计划子活动的执行。Called by a composite activity to schedule the execution of a child activity. 工作流运行时禁止执行未处于已初始化状态的子活动。The workflow runtime disallows execution of a child activity that is not in the initialized state.

public:
 void ExecuteActivity(System::Workflow::ComponentModel::Activity ^ activity);
public void ExecuteActivity (System.Workflow.ComponentModel.Activity activity);
member this.ExecuteActivity : System.Workflow.ComponentModel.Activity -> unit
Public Sub ExecuteActivity (activity As Activity)

参数

activity
Activity

已执行的 ActivityThe executed Activity.

例外

activity 为空引用(在 Visual Basic 中为 Nothing)。activity is a null reference (Nothing in Visual Basic).

activity 不是 ActivityExecutionContext 的有效子级。activity is not a valid child of the ActivityExecutionContext. 这意味着参数等于关联的 Activity,或者参数未处于注释状态并且是与此 Activity 关联的 ActivityExecutionContext 的子级。This means that either the argument is equal to the associated Activity or that the argument is not in the commented state and is a child of the Activity associated with this ActivityExecutionContext.

状态既不是已初始化,也不是 ClosedThe status is neither initialized nor Closed.

注解

如果状态为 Closed,则初始化并执行 ActivityIf the status is Closed, the Activity is initialized and executed.

适用于