共用方式為


WorkflowApplication.Load 方法

定義

從執行個體存放區載入工作流程執行個體。

多載

Load(WorkflowApplicationInstance)

以指定的執行個體,從執行個體存放區載入工作流程執行個體。

Load(Guid)

將指定的工作流程執行個體從執行個體存放區載入記憶體中。

Load(WorkflowApplicationInstance, DynamicUpdateMap)

以指定的執行個體和更新對應,從執行個體存放區載入工作流程執行個體。

Load(WorkflowApplicationInstance, TimeSpan)

以指定的執行個體和逾時間隔,從執行個體存放區載入工作流程執行個體。

Load(Guid, TimeSpan)

使用指定逾時間隔,將指定的工作流程執行個體從執行個體存放區載入記憶體。

Load(WorkflowApplicationInstance, DynamicUpdateMap, TimeSpan)

以指定的執行個體、更新對應和逾時間隔,從執行個體存放區載入工作流程執行個體。

Load(WorkflowApplicationInstance)

以指定的執行個體,從執行個體存放區載入工作流程執行個體。

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)

參數

instance
WorkflowApplicationInstance

執行個體。

適用於

Load(Guid)

將指定的工作流程執行個體從執行個體存放區載入記憶體中。

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

參數

instanceId
Guid

工作流程執行個體的全域唯一 128 位元識別碼。

範例

下列範例會呼叫 Load,從 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();

適用於

Load(WorkflowApplicationInstance, DynamicUpdateMap)

以指定的執行個體和更新對應,從執行個體存放區載入工作流程執行個體。

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)

參數

instance
WorkflowApplicationInstance

執行個體。

updateMap
DynamicUpdateMap

更新對應。

適用於

Load(WorkflowApplicationInstance, TimeSpan)

以指定的執行個體和逾時間隔,從執行個體存放區載入工作流程執行個體。

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)

參數

instance
WorkflowApplicationInstance

執行個體。

timeout
TimeSpan

開始載入作業必須在作業取消前完成的間隔。

適用於

Load(Guid, TimeSpan)

使用指定逾時間隔,將指定的工作流程執行個體從執行個體存放區載入記憶體。

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)

參數

instanceId
Guid

工作流程執行個體的全域唯一 128 位元識別碼。

timeout
TimeSpan

載入作業必須在載入作業取消並擲回 TimeoutException 前完成的間隔。

範例

下列範例會呼叫 Load,從 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();

適用於

Load(WorkflowApplicationInstance, DynamicUpdateMap, TimeSpan)

以指定的執行個體、更新對應和逾時間隔,從執行個體存放區載入工作流程執行個體。

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)

參數

instance
WorkflowApplicationInstance

執行個體。

updateMap
DynamicUpdateMap

更新對應。

timeout
TimeSpan

開始載入作業必須在作業取消前完成的間隔。

適用於