SqlWorkflowPersistenceService 類別

定義

警告

The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*

代表使用 SQL 資料庫儲存工作流程狀態資訊的持續性服務。

public ref class SqlWorkflowPersistenceService : System::Workflow::Runtime::Hosting::WorkflowPersistenceService, System::Workflow::Runtime::IPendingWork
public class SqlWorkflowPersistenceService : System.Workflow.Runtime.Hosting.WorkflowPersistenceService, System.Workflow.Runtime.IPendingWork
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public class SqlWorkflowPersistenceService : System.Workflow.Runtime.Hosting.WorkflowPersistenceService, System.Workflow.Runtime.IPendingWork
type SqlWorkflowPersistenceService = class
    inherit WorkflowPersistenceService
    interface IPendingWork
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type SqlWorkflowPersistenceService = class
    inherit WorkflowPersistenceService
    interface IPendingWork
Public Class SqlWorkflowPersistenceService
Inherits WorkflowPersistenceService
Implements IPendingWork
繼承
屬性
實作

備註

注意

此資料討論已被汰換的類型及命名空間。 如需詳細資訊,請參閱 Windows Workflow Foundation 4.5 中即將淘汰的類型

SqlWorkflowPersistenceService 類別代表功能完整的持續性服務。 您可以在工作流程執行階段引擎要求時,使用此全新的服務保留和擷取有關工作流程執行個體的工作流程狀態資訊。

SqlWorkflowPersistenceService 會參與 WorkflowCommitWorkBatchService 提供的工作流程交易批次功能。 也就是,它會將表示暫停寫入 SQL 資料庫的物件新增至 WorkBatch,並實作 IPendingWork 介面。

SqlWorkflowPersistenceService 支援工作流程執行個體鎖定。 當數個工作流程執行階段共用相同的資料庫時,會使用此功能。 如果工作流程執行階段正在使用某個工作流程執行個體,SQL 資料庫資料表中會有一個資料行將該工作流程執行個體標示為鎖定。 SqlWorkflowPersistenceService 不會載入標示為由其他執行階段「使用中」的工作流程執行個體。 一般而言,當工作流程執行個體被保存時 (例如,閒置、完成或終止時),就會釋放這些鎖定。 若經過一段時間沒有活動,也可自動釋放鎖定。 您可使用 SqlWorkflowPersistenceService 類別的建構函式來設定這段無活動的時間間隔, 亦可使用組態檔來加以設定。

如需一般持續性服務的詳細資訊,請參閱 類別 WorkflowPersistenceService

例如,若工作流程執行個體含有 DelayActivity,那它可以包含計時器。 對於包含計時器的工作流程,SqlWorkflowPersistenceService 會記錄下一次工作流程計時器過期的時間。 SqlWorkflowPersistenceService 會定期輪詢資料庫,尋找計時器已過期的工作流程。 使用 SqlWorkflowPersistenceService 建構函式或組態檔,即可設定輪詢間隔的頻率。

注意

在工作流程應用程式中使用 SqlTrackingServiceSqlWorkflowPersistenceService 時,建議您使用單一資料庫進行保存和追蹤。

建構函式

SqlWorkflowPersistenceService(NameValueCollection)
已淘汰.

使用指定的參數初始化 SqlWorkflowPersistenceService 類別的新執行個體。

SqlWorkflowPersistenceService(String)
已淘汰.

使用資料庫連線字串,初始化 SqlWorkflowPersistenceService 類別的新執行個體。

SqlWorkflowPersistenceService(String, Boolean, TimeSpan, TimeSpan)
已淘汰.

使用資料庫連線字串與其他參數,初始化 SqlWorkflowPersistenceService 類別的新執行個體。

屬性

EnableRetries
已淘汰.

取得或設定值,指定 SqlWorkflowPersistenceService 是否要重試認可工作批次。

LoadingInterval
已淘汰.

取得載入時間間隔的長度。

Runtime
已淘汰.

取得此服務的 WorkflowRuntime

(繼承來源 WorkflowRuntimeService)
ServiceInstanceId
已淘汰.

取得服務執行個體識別項。

State
已淘汰.

取得 WorkflowRuntimeService 的狀態。

(繼承來源 WorkflowRuntimeService)

方法

Equals(Object)
已淘汰.

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetAllWorkflows()
已淘汰.

擷取所有已保存工作流程的執行個體描述。

GetHashCode()
已淘汰.

做為預設雜湊函式。

(繼承來源 Object)
GetType()
已淘汰.

取得目前執行個體的 Type

(繼承來源 Object)
LoadCompletedContextActivity(Guid, Activity)
已淘汰.

從資料庫擷取指定的完成範圍。

LoadExpiredTimerWorkflowIds()
已淘汰.

擷取有到期計時器的工作流程 ID 清單。

LoadWorkflowInstanceState(Guid)
已淘汰.

從資料庫擷取指定的工作流程執行個體狀態。

MemberwiseClone()
已淘汰.

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnStarted()
已淘汰.

啟動新的計時器並復原執行中的工作流程執行個體。

OnStopped()
已淘汰.

在衍生類別中覆寫時,代表在工作流程執行階段引擎引發 Stopped 事件時將呼叫的方法。

(繼承來源 WorkflowRuntimeService)
RaiseServicesExceptionNotHandledEvent(Exception, Guid)
已淘汰.

引發 ServicesExceptionNotHandled 事件。

(繼承來源 WorkflowRuntimeService)
SaveCompletedContextActivity(Activity)
已淘汰.

儲存指定完成範圍的狀態。

SaveWorkflowInstanceState(Activity, Boolean)
已淘汰.

儲存指定的工作流程執行個體狀態。

Start()
已淘汰.

啟動 SqlWorkflowPersistenceService

Stop()
已淘汰.

停止服務和計時器。

ToString()
已淘汰.

傳回代表目前物件的字串。

(繼承來源 Object)
UnloadOnIdle(Activity)
已淘汰.

傳回值,這個值會指示是否要在工作流程於閒置狀態時將其卸載。

UnlockWorkflowInstanceState(Activity)
已淘汰.

解除鎖定對指定之工作流程執行個體狀態的存取。

明確介面實作

IPendingWork.Commit(Transaction, ICollection)
已淘汰.

將序列化狀態物件的 ICollection 寫入資料庫中。

IPendingWork.Complete(Boolean, ICollection)
已淘汰.

完成工作批次並釋放任何資源。

IPendingWork.MustCommit(ICollection)
已淘汰.

傳回值,這個值會指出是否應將序列化狀態物件的集合寫入資料庫中。

適用於