Editar

Compartir a través de


WorkflowInstance.GetWorkflowDefinition Method

Definition

Retrieves the root activity for this workflow instance.

public:
 System::Workflow::ComponentModel::Activity ^ GetWorkflowDefinition();
public System.Workflow.ComponentModel.Activity GetWorkflowDefinition ();
member this.GetWorkflowDefinition : unit -> System.Workflow.ComponentModel.Activity
Public Function GetWorkflowDefinition () As Activity

Returns

An Activity object.

Examples

The following example demonstrates retrieving the workflow definition from a workflow instance. This example is from the Ordering State Machine SDK sample, from the Mainform.cs file. For more information, see the Ordering State Machine Sample.

// Get a reference to the root activity for the workflow
Activity root = instance.GetWorkflowDefinition();
' Get a reference to the root activity for the workflow
Dim root As Activity = instance.GetWorkflowDefinition()

Remarks

You can use the root activity to navigate the activity hierarchy of the workflow.

This method is not thread safe, so the host should synchronize its calls to this method.

Applies to