WorkflowRuntime.GetLoadedWorkflows Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a collection that contains all the workflow instances currently loaded in memory.
public:
System::Collections::ObjectModel::ReadOnlyCollection<System::Workflow::Runtime::WorkflowInstance ^> ^ GetLoadedWorkflows();
public System.Collections.ObjectModel.ReadOnlyCollection<System.Workflow.Runtime.WorkflowInstance> GetLoadedWorkflows ();
member this.GetLoadedWorkflows : unit -> System.Collections.ObjectModel.ReadOnlyCollection<System.Workflow.Runtime.WorkflowInstance>
Public Function GetLoadedWorkflows () As ReadOnlyCollection(Of WorkflowInstance)
Returns
A WorkflowInstance object for each workflow instance currently loaded in memory.
Exceptions
The WorkflowRuntime is disposed.
Examples
The following example demonstrates how to retrieve a collection of loaded workflows from a WorkflowRuntime object.
// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Start the runtime
workflowRuntime.StartRuntime();
// Create a collection of workflow instances
ReadOnlyCollection<WorkflowInstance> workflows;
// Populate the collection of workflow instances
workflows = workflowRuntime.GetLoadedWorkflows();
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Start the runtime
workflowRuntime.StartRuntime()
' Create a collection of workflow instances
Dim workflows As ReadOnlyCollection(Of WorkflowInstance)
' Populate the collection of workflow instances
workflows = workflowRuntime.GetLoadedWorkflows()
Remarks
Note that, unlike GetWorkflow, this method does not throw a InvalidOperationException if the runtime is not started.