WorkflowInstance.Load Method ()
Loads a previously unloaded workflow instance.
Assembly: System.Workflow.Runtime (in System.Workflow.Runtime.dll)
WorkflowLoaded event after the persistence service has restored the workflow instance in memory, but before the workflow runtime engine schedules the instance.is synchronous; if the workflow instance can be loaded, will return after the workflow instance has been loaded into memory and scheduled by the workflow runtime engine. The runtime raises the
The following example demonstrates how to load a previously unloaded WorkflowInstance object.
// Create a WorkflowRuntime object WorkflowRuntime workflowRuntime = new WorkflowRuntime(); // Create a new instance of the out-of-box SqlWorkflowPersistenceService SqlWorkflowPersistenceService persistenceService = new SqlWorkflowPersistenceService( "Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI;"); // Add the service to the runtime workflowRuntime.AddService(persistenceService); // Create a WorkflowInstance object WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(typeof(Workflow1)); // Start the workflow instance workflowInstance.Start(); //Unload the instance workflowInstance.Unload(); //Reload the previously unloaded instance workflowInstance.Load();
Available since 3.0