WorkflowRuntime.GetLoadedWorkflows Method ()


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a collection that contains all the workflow instances currently loaded in memory.

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

public ReadOnlyCollection<WorkflowInstance> GetLoadedWorkflows()

Return Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<WorkflowInstance>

A WorkflowInstance object for each workflow instance currently loaded in memory.

Exception Condition

The WorkflowRuntime is disposed.

Note that, unlike GetWorkflow, this method does not throw a InvalidOperationException if the runtime is not started.

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
// Create a collection of workflow instances
ReadOnlyCollection<WorkflowInstance> workflows;
// Populate the collection of workflow instances
workflows = workflowRuntime.GetLoadedWorkflows();

.NET Framework
Available since 3.0
Return to top