WorkflowApplication.Load Method

Definition

Loads a workflow instance from an instance store.

Overloads

Load(WorkflowApplicationInstance)

Loads a workflow instance from an instance store with specified instance.

Load(Guid)

Loads the specified workflow instance into memory from an instance store.

Load(WorkflowApplicationInstance, DynamicUpdateMap)

Loads a workflow instance from an instance store with specified instance and update map.

Load(WorkflowApplicationInstance, TimeSpan)

Loads a workflow instance from an instance store with specified instance and timeout interval.

Load(Guid, TimeSpan)

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

Load(WorkflowApplicationInstance, DynamicUpdateMap, TimeSpan)

Loads a workflow instance from an instance store with specified instance, update map and timeout interval.

Load(WorkflowApplicationInstance)

Loads a workflow instance from an instance store with specified instance.

C#
public void Load(System.Activities.WorkflowApplicationInstance instance);

Parameters

instance
WorkflowApplicationInstance

The instance.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Load(Guid)

Loads the specified workflow instance into memory from an instance store.

C#
public void Load(Guid instanceId);

Parameters

instanceId
Guid

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

Examples

The following example calls Load to load persisted workflow instance from a SqlWorkflowInstanceStore.

C#
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();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Load(WorkflowApplicationInstance, DynamicUpdateMap)

Loads a workflow instance from an instance store with specified instance and update map.

C#
public void Load(System.Activities.WorkflowApplicationInstance instance, System.Activities.DynamicUpdate.DynamicUpdateMap updateMap);

Parameters

instance
WorkflowApplicationInstance

The instance.

updateMap
DynamicUpdateMap

The update map.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Load(WorkflowApplicationInstance, TimeSpan)

Loads a workflow instance from an instance store with specified instance and timeout interval.

C#
public void Load(System.Activities.WorkflowApplicationInstance instance, TimeSpan timeout);

Parameters

instance
WorkflowApplicationInstance

The instance.

timeout
TimeSpan

The interval in which the begin load operation must complete before the operation is canceled.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Load(Guid, TimeSpan)

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

C#
public void Load(Guid instanceId, TimeSpan timeout);

Parameters

instanceId
Guid

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

timeout
TimeSpan

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

Examples

The following example calls Load to load persisted workflow instance from a SqlWorkflowInstanceStore.

C#
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();

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Load(WorkflowApplicationInstance, DynamicUpdateMap, TimeSpan)

Loads a workflow instance from an instance store with specified instance, update map and timeout interval.

C#
public void Load(System.Activities.WorkflowApplicationInstance instance, System.Activities.DynamicUpdate.DynamicUpdateMap updateMap, TimeSpan timeout);

Parameters

instance
WorkflowApplicationInstance

The instance.

updateMap
DynamicUpdateMap

The update map.

timeout
TimeSpan

The interval in which the begin load operation must complete before the operation is canceled.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1