Creating the WorkflowRuntime

The default mechanism for initializing Windows Workflow Foundation is to use the WorkflowRuntime class, as follows:

Imports System
Imports System.Threading
Imports System.Workflow.Runtime
Imports System.Workflow.Runtime.Hosting

Class Program

    Shared Sub Main()
        Using workflowRuntime As WorkflowRuntime = New WorkflowRuntime()
        End Using
    End Sub
End Class
using System;
using System.Threading;
using System.Workflow.Runtime;
using System.Workflow.Runtime.Hosting;

class Program
{
    static void Main(string[] args)
    {
        using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())
        {
        }
    }
}

In the using statement body, a WorkflowRuntime object is initialized and ready for use. At this point, you can create event handlers to handle events that are raised by the runtime engine, retrieve and configure any of the base services used by the runtime engine, and finally create and start a workflow instance. For more information about Windows Workflow Foundation services, see Windows Workflow Foundation Services.

See Also

Concepts

Processing WorkflowRuntime Events
Running Workflows