WorkflowPersistenceService.UnlockWorkflowInstanceState(Activity) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在派生类中重写时,解除对工作流实例状态的锁定。
protected public:
abstract void UnlockWorkflowInstanceState(System::Workflow::ComponentModel::Activity ^ rootActivity);
protected internal abstract void UnlockWorkflowInstanceState (System.Workflow.ComponentModel.Activity rootActivity);
abstract member UnlockWorkflowInstanceState : System.Workflow.ComponentModel.Activity -> unit
Protected Friend MustOverride Sub UnlockWorkflowInstanceState (rootActivity As Activity)
参数
- rootActivity
- Activity
工作流实例的根活动。
示例
下面的示例演示 UnlockWorkflowInstanceState
方法的实现。 此示例摘自 FilePersistenceService.cs 文件中的“自定义持久性服务”示例。 有关详细信息,请参阅 自定义持久性服务示例。
// Unlock the workflow instance state.
// Instance state locking is necessary when multiple runtimes share instance persistence store
protected override void UnlockWorkflowInstanceState(Activity state)
{
//File locking is not supported in this sample
}
' unlock workflow instance state.
' instance state locking is necessary when multiple runtimes share instance persistence store
Protected Overrides Sub UnlockWorkflowInstanceState(ByVal rootActivity As System.Workflow.ComponentModel.Activity)
' File locking is not supported in this sample
End Sub
注解
此方法是抽象的,因此它不包含对锁定和解锁的默认实现。
实现自定义持久性服务时,如果要实现锁定方案,则需要重写此方法,并在 SaveWorkflowInstanceState 方法中提供根据解锁参数的值进行锁定-解锁的机制。