Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WorkflowEventArgs::WorkflowInstance Property

 

Gets the workflow instance associated with the workflow event.

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

public:
property WorkflowInstance^ WorkflowInstance {
	WorkflowInstance^ get();
}

Property Value

Type: System.Workflow.Runtime::WorkflowInstance^

The WorkflowInstance associated with the workflow event.

The following code example demonstrates how to obtain a WorkflowInstance object using the WorkflowInstance property when an event handler method is called. When the WorkflowIdled event occurs, the OnWorkflowIdled method defined in this example is called. It determines which workflow is idled using the WorkflowInstance property and then gets a collection of queued items for the workflow instance by calling the GetWorkflowQueueData method. The code iterates over the collection to determine which activity is waiting for the event that idled the workflow. It then sends an exception to the workflow queue using the EnqueueItem method along with the name of the event queue item.

This code example is part of the Canceling a Workflow SDK Sample from the Program.cs file. For more information, see Canceling a Workflow.

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

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft