Rediger

Del via


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.

public:
 void Load(System::Activities::WorkflowApplicationInstance ^ instance);
public void Load (System.Activities.WorkflowApplicationInstance instance);
member this.Load : System.Activities.WorkflowApplicationInstance -> unit
Public Sub Load (instance As WorkflowApplicationInstance)

Parameters

instance
WorkflowApplicationInstance

The instance.

Applies to

Load(Guid)

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

public:
 void Load(Guid instanceId);
public void Load (Guid instanceId);
member this.Load : Guid -> unit
Public Sub Load (instanceId As Guid)

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.

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

Load(WorkflowApplicationInstance, DynamicUpdateMap)

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

public:
 void Load(System::Activities::WorkflowApplicationInstance ^ instance, System::Activities::DynamicUpdate::DynamicUpdateMap ^ updateMap);
public void Load (System.Activities.WorkflowApplicationInstance instance, System.Activities.DynamicUpdate.DynamicUpdateMap updateMap);
member this.Load : System.Activities.WorkflowApplicationInstance * System.Activities.DynamicUpdate.DynamicUpdateMap -> unit
Public Sub Load (instance As WorkflowApplicationInstance, updateMap As DynamicUpdateMap)

Parameters

instance
WorkflowApplicationInstance

The instance.

updateMap
DynamicUpdateMap

The update map.

Applies to

Load(WorkflowApplicationInstance, TimeSpan)

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

public:
 void Load(System::Activities::WorkflowApplicationInstance ^ instance, TimeSpan timeout);
public void Load (System.Activities.WorkflowApplicationInstance instance, TimeSpan timeout);
member this.Load : System.Activities.WorkflowApplicationInstance * TimeSpan -> unit
Public Sub Load (instance As WorkflowApplicationInstance, timeout As TimeSpan)

Parameters

instance
WorkflowApplicationInstance

The instance.

timeout
TimeSpan

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

Applies to

Load(Guid, TimeSpan)

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

public:
 void Load(Guid instanceId, TimeSpan timeout);
public void Load (Guid instanceId, TimeSpan timeout);
member this.Load : Guid * TimeSpan -> unit
Public Sub Load (instanceId As Guid, timeout As TimeSpan)

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.

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

Load(WorkflowApplicationInstance, DynamicUpdateMap, TimeSpan)

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

public:
 void Load(System::Activities::WorkflowApplicationInstance ^ instance, System::Activities::DynamicUpdate::DynamicUpdateMap ^ updateMap, TimeSpan timeout);
public void Load (System.Activities.WorkflowApplicationInstance instance, System.Activities.DynamicUpdate.DynamicUpdateMap updateMap, TimeSpan timeout);
member this.Load : System.Activities.WorkflowApplicationInstance * System.Activities.DynamicUpdate.DynamicUpdateMap * TimeSpan -> unit
Public Sub Load (instance As WorkflowApplicationInstance, updateMap As DynamicUpdateMap, timeout As TimeSpan)

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