Activity::Execute Method (ActivityExecutionContext^)

 

Called by the workflow runtime to execute an activity.

Namespace:   System.Workflow.ComponentModel
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

public protected:
virtual ActivityExecutionStatus Execute(
	ActivityExecutionContext^ executionContext
)

Parameters

executionContext
Type: System.Workflow.ComponentModel::ActivityExecutionContext^

The ActivityExecutionContext to associate with this Activity and execution.

Return Value

Type: System.Workflow.ComponentModel::ActivityExecutionStatus

The ActivityExecutionStatus of the run task, which determines whether the activity remains in the executing state, or transitions to the closed state.

The ActivityExecutionContext is used to get information about the currently running activity and workflow, and is also used to obtain services from the runtime environment.

The running occurs synchronously, returning control to the caller when the activity is completed or reaches an intermediate state.

The following code example shows an implementation of the Execute method. In this example, an Outlook e-mail message is constructed and sent. This example is from the Outlook Workflow Wizard SDK sample. For more information, seeOutlook Workflow Wizard Sample.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show: