WorkflowRuntime Class
Note: This API is now obsolete.
Represents the configurable execution environment provided by the workflow run-time engine for workflows.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
The WorkflowRuntime type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | WorkflowRuntime() | Initializes a new instance of the WorkflowRuntime class. |
![]() | WorkflowRuntime(String) | Initializes a new instance of the WorkflowRuntime class by using the specified section of the application configuration file. |
![]() | WorkflowRuntime(WorkflowRuntimeSection) | Initializes a new instance of the WorkflowRuntime class by using the settings in the specified WorkflowRuntimeSection. |
| Name | Description | |
|---|---|---|
![]() | AddService | Adds the specified service to the workflow run-time engine. |
![]() | CreateWorkflow(Type) | Creates a new workflow instance by using the specified workflow Type. |
![]() | CreateWorkflow(XmlReader) | Creates a workflow instance by using the specified XmlReader. |
![]() | CreateWorkflow(Type, Dictionary<String, Object>) | Creates a workflow instance by using the specified workflow Type and the arguments to the workflow contained in the specified Dictionary<TKey, TValue>. |
![]() | CreateWorkflow(Type, Dictionary<String, Object>, Guid) | Creates a workflow instance by using the specified parameters. |
![]() | CreateWorkflow(XmlReader, XmlReader, Dictionary<String, Object>) | Creates a workflow instance by using the specified XmlReader objects and the arguments contained in the specified Dictionary<TKey, TValue>. |
![]() | CreateWorkflow(XmlReader, XmlReader, Dictionary<String, Object>, Guid) | Creates a workflow instance by using the specified parameters. |
![]() | Dispose | Releases the resources used by the WorkflowRuntime. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetAllServices(Type) | Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified Type. |
![]() | GetAllServices<T>() | Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified generic type. |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLoadedWorkflows | Gets a collection that contains all the workflow instances currently loaded in memory. |
![]() | GetService(Type) | Retrieves a service of the specified Type from the workflow run-time engine. |
![]() | GetService<T>() | Retrieves a service of the specified generic type from the workflow run-time engine. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | GetWorkflow | Retrieves the workflow instance that has the specified Guid. |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | RemoveService | Removes the specified service from the workflow run-time engine. |
![]() | StartRuntime | Starts the workflow run-time engine and the workflow run-time engine services. |
![]() | StopRuntime | Stops the workflow run-time engine and the run-time services. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | ServicesExceptionNotHandled | Occurs when a service that is derived from the WorkflowRuntimeService class calls RaiseServicesExceptionNotHandledEvent. |
![]() | Started | Occurs when the workflow run-time engine is started. |
![]() | Stopped | Occurs when the workflow run-time engine is stopped. |
![]() | WorkflowAborted | Occurs when a workflow instance is aborted. |
![]() | WorkflowCompleted | Occurs when a workflow instance has completed. |
![]() | WorkflowCreated | Occurs when a workflow instance is created. |
![]() | WorkflowIdled | Occurs when a workflow instance enters the idle state. |
![]() | WorkflowLoaded | Occurs when the workflow instance is loaded into memory. |
![]() | WorkflowPersisted | Occurs when the state of a workflow instance is persisted. |
![]() | WorkflowResumed | Occurs when execution of a workflow instance is resumed following a suspension. |
![]() | WorkflowStarted | Occurs when a workflow instance has been started. |
![]() | WorkflowSuspended | Occurs when a workflow instance is suspended. |
![]() | WorkflowTerminated | Occurs when a workflow instance is terminated. |
![]() | WorkflowUnloaded | Occurs when the workflow instance is unloaded from memory. |
Note |
|---|
This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5. |
WorkflowRuntime exposes functionality required by a host application and services to configure and control the workflow run-time engine and to be notified of changes to both the workflow run-time engine and any of its workflow instances.
The following code example demonstrates how to use WorkflowRuntime functionality from a workflow host. It provides examples of how to use the WorkflowRuntime constructor and the AddService, StartRuntime, and StopRuntime methods. The code also shows the recommended way to create a WorkflowInstance object in a workflow host using the CreateWorkflow method. It also shows how to set event handlers for the WorkflowCompleted, WorkflowIdled, and WorkflowTerminated events.
This code example is part of the Canceling a Workflow sample.
static void Main() { string connectionString = "Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI;"; using (WorkflowRuntime workflowRuntime = new WorkflowRuntime()) { ExternalDataExchangeService dataService = new ExternalDataExchangeService(); workflowRuntime.AddService(dataService); dataService.AddService(expenseService); workflowRuntime.AddService(new SqlWorkflowPersistenceService(connectionString)); workflowRuntime.StartRuntime(); workflowRuntime.WorkflowCompleted += OnWorkflowCompleted; workflowRuntime.WorkflowTerminated += OnWorkflowTerminated; workflowRuntime.WorkflowIdled += OnWorkflowIdled; workflowRuntime.WorkflowAborted += OnWorkflowAborted; Type type = typeof(SampleWorkflow1); WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(type); workflowInstance.Start(); waitHandle.WaitOne(); workflowRuntime.StopRuntime(); } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
