The following code example demonstrates how you can use WorkflowRuntime functionality from a workflow host. The code associates the WorkflowCompleted with an event handler, a method named OnWorkflowCompleted.
This code example is part of the Canceling a Workflow SDK sample from the Program.cs file. For more information, see Canceling a Workflow.
Dim workflowInstance As WorkflowInstance
workflowInstance = workflowRuntime.CreateWorkflow(GetType(SampleWorkflow))
workflowInstance.Start()
Type type = typeof(SampleWorkflow1);
WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(type);
workflowInstance.Start();