WorkflowApplication.Load Method (Guid, TimeSpan)

.NET Framework (current version)
 

Loads the specified workflow instance into memory from an instance store using the specified time-out interval.

Namespace:   System.Activities
Assembly:  System.Activities (in System.Activities.dll)

Public Sub Load (
	instanceId As Guid,
	timeout As TimeSpan
)

Parameters

instanceId
Type: System.Guid

A globally unique 128-bit identifier for the workflow instance.

timeout
Type: System.TimeSpan

The interval in which the load operation must complete before the load operation is canceled and a TimeoutException is thrown.

The following example calls Load to load persisted workflow instance from a SqlWorkflowInstanceStore. This example is from the LoadAndCompleteInstance method in the Persisting a Workflow Application sample.

string input = Console.ReadLine();

WorkflowApplication application = new WorkflowApplication(activity);
application.InstanceStore = instanceStore;

application.Completed = (workflowApplicationCompletedEventArgs) =>
{
    Console.WriteLine("\nWorkflowApplication has Completed in the {0} state.", workflowApplicationCompletedEventArgs.CompletionState);
};

application.Unloaded = (workflowApplicationEventArgs) =>
{
    Console.WriteLine("WorkflowApplication has Unloaded\n");
    instanceUnloaded.Set();
};

application.Load(id);

//this resumes the bookmark setup by readline
application.ResumeBookmark(readLineBookmark, input);

instanceUnloaded.WaitOne();

.NET Framework
Available since 4.0
Return to top
Show: