WorkflowApplication.Load 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从实例存储区加载工作流实例。
重载
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
开始加载操作必须在取消操作前的间隔。