WorkflowRuntime::GetWorkflow Method (Guid)
Retrieves the workflow instance that has the specified Guid.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
Parameters
- instanceId
-
Type:
System::Guid
The Guid of a workflow instance.
Return Value
Type: System.Workflow.Runtime::WorkflowInstance^The WorkflowInstance that has the specified Guid.
| Exception | Condition |
|---|---|
| InvalidOperationException | The workflow runtime is not started. |
If instanceId specifies a workflow instance that is not currently in memory, the workflow instance is loaded into memory and scheduled for execution. For example, after a workflow instance is aborted, you can call GetWorkflow to load the workflow instance back into memory. In this case, the last persisted state of the workflow instance is loaded into memory by the persistence service.
The following code example demonstrates a ReloadWorkflow method that calls the GetWorkflow method. The ReloadWorkflow method is part of a larger class that has a Runtime property to access all of the methods, properties, and events of the WorkflowRuntime class.
This code example is part of the Custom Persistence Service Sample sample.
Available since 3.0
