Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WorkflowRuntime Class

 
Note: This API is now obsolete.

Represents the configurable execution environment provided by the workflow run-time engine for workflows.

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

System.Object
  System.Workflow.Runtime.WorkflowRuntime

<ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>
Public Class WorkflowRuntime
	Implements IServiceProvider, IDisposable

NameDescription
System_CAPS_pubmethodWorkflowRuntime()

Initializes a new instance of the WorkflowRuntime class.

System_CAPS_pubmethodWorkflowRuntime(String)

Initializes a new instance of the WorkflowRuntime class by using the specified section of the application configuration file.

System_CAPS_pubmethodWorkflowRuntime(WorkflowRuntimeSection)

Initializes a new instance of the WorkflowRuntime class by using the settings in the specified WorkflowRuntimeSection.

NameDescription
System_CAPS_pubpropertyIsStarted

Gets a value that indicates whether the workflow run-time engine has been started.

System_CAPS_pubpropertyName

Gets or sets the name associated with the WorkflowRuntime.

NameDescription
System_CAPS_pubmethodAddService(Object)

Adds the specified service to the workflow run-time engine.

System_CAPS_pubmethodCreateWorkflow(Type)

Creates a new workflow instance by using the specified workflow Type.

System_CAPS_pubmethodCreateWorkflow(Type, Dictionary(Of String, Object))

Creates a workflow instance by using the specified workflow Type and the arguments to the workflow contained in the specified Dictionary(Of TKey, TValue).

System_CAPS_pubmethodCreateWorkflow(Type, Dictionary(Of String, Object), Guid)

Creates a workflow instance by using the specified parameters.

System_CAPS_pubmethodCreateWorkflow(XmlReader)

Creates a workflow instance by using the specified XmlReader.

System_CAPS_pubmethodCreateWorkflow(XmlReader, XmlReader, Dictionary(Of String, Object))

Creates a workflow instance by using the specified XmlReader objects and the arguments contained in the specified Dictionary(Of TKey, TValue).

System_CAPS_pubmethodCreateWorkflow(XmlReader, XmlReader, Dictionary(Of String, Object), Guid)

Creates a workflow instance by using the specified parameters.

System_CAPS_pubmethodDispose()

Releases the resources used by the WorkflowRuntime.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetAllServices(Type)

Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified Type.

System_CAPS_pubmethodGetAllServices(Of T)()

Retrieves all the services that are added to the workflow run-time engine that implement or derive from the specified generic type.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLoadedWorkflows()

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

System_CAPS_pubmethodGetService(Type)

Retrieves a service of the specified Type from the workflow run-time engine.

System_CAPS_pubmethodGetService(Of T)()

Retrieves a service of the specified generic type from the workflow run-time engine.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodGetWorkflow(Guid)

Retrieves the workflow instance that has the specified Guid.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemoveService(Object)

Removes the specified service from the workflow run-time engine.

System_CAPS_pubmethodStartRuntime()

Starts the workflow run-time engine and the workflow run-time engine services.

System_CAPS_pubmethodStopRuntime()

Stops the workflow run-time engine and the run-time services.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubeventServicesExceptionNotHandled

Occurs when a service that is derived from the WorkflowRuntimeService class calls RaiseServicesExceptionNotHandledEvent.

System_CAPS_pubeventStarted

Occurs when the workflow run-time engine is started.

System_CAPS_pubeventStopped

Occurs when the workflow run-time engine is stopped.

System_CAPS_pubeventWorkflowAborted

Occurs when a workflow instance is aborted.

System_CAPS_pubeventWorkflowCompleted

Occurs when a workflow instance has completed.

System_CAPS_pubeventWorkflowCreated

Occurs when a workflow instance is created.

System_CAPS_pubeventWorkflowIdled

Occurs when a workflow instance enters the idle state.

System_CAPS_pubeventWorkflowLoaded

Occurs when the workflow instance is loaded into memory.

System_CAPS_pubeventWorkflowPersisted

Occurs when the state of a workflow instance is persisted.

System_CAPS_pubeventWorkflowResumed

Occurs when execution of a workflow instance is resumed following a suspension.

System_CAPS_pubeventWorkflowStarted

Occurs when a workflow instance has been started.

System_CAPS_pubeventWorkflowSuspended

Occurs when a workflow instance is suspended.

System_CAPS_pubeventWorkflowTerminated

Occurs when a workflow instance is terminated.

System_CAPS_pubeventWorkflowUnloaded

Occurs when the workflow instance is unloaded from memory.

System_CAPS_noteNote

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.

Shared Sub Main()
    Dim connectionString As String = "Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI;"
    Using workflowRuntime As New WorkflowRuntime()
        Dim dataService As New ExternalDataExchangeService()
        workflowRuntime.AddService(dataService)
        dataService.AddService(expenseService)

        workflowRuntime.AddService(New SqlWorkflowPersistenceService(connectionString))


        AddHandler workflowRuntime.WorkflowCompleted, AddressOf OnWorkflowCompleted
        AddHandler workflowRuntime.WorkflowTerminated, AddressOf OnWorkflowTerminated
        AddHandler workflowRuntime.WorkflowIdled, AddressOf OnWorkflowIdled
        AddHandler workflowRuntime.WorkflowAborted, AddressOf OnWorkflowAborted


        Dim workflowInstance As WorkflowInstance
        workflowInstance = workflowRuntime.CreateWorkflow(GetType(SampleWorkflow))
        workflowInstance.Start()

        waitHandle.WaitOne()

        workflowRuntime.StopRuntime()
    End Using
End Sub

.NET Framework
Available since 3.0

This type is thread safe.

Return to top
Show:
© 2017 Microsoft