Bewerken

Share via


WorkflowRuntime.GetLoadedWorkflows Method

Definition

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

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.

Applies to