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
繼承
屬性
實作

備註

Note

此數據會討論已過時的類型和命名空間。 欲了解更多資訊,請參閱 Windows Workflow Foundation 4.5 中的 Deprecated Types。

這個 SqlWorkflowPersistenceService 類別代表一個功能完整的持久化服務。 你可以直接使用此服務,當工作流程執行引擎請求時,持續保存並取得工作流程實例的狀態資訊。

參與SqlWorkflowPersistenceService由 .WorkflowCommitWorkBatchService 也就是說,它會新增代表待處理寫入 SQL 資料庫的物件,WorkBatch並實作介面。IPendingWork

SqlWorkflowPersistenceService支援鎖定工作流程實例。 此功能用於多個工作流程執行時共用同一資料庫。 SQL 資料庫資料表中的欄位用於在工作流執行時標記該工作流實例為鎖定狀態。 它 SqlWorkflowPersistenceService 不會載入被其他執行時標記為「正在使用」的工作流程實例。 通常這些鎖會在工作流程實例持續存在時解除,例如在閒置、完成或終止時。 鎖也可以在一段時間內不啟用後自動解除。 這個不活動期間可透過類別的 SqlWorkflowPersistenceService 建構子設定。 也可以透過設定檔設定。

欲了解更多關於持久化服務的資訊,請參閱該 WorkflowPersistenceService 類別。

工作流程實例可以包含計時器,例如如果它們有 DelayActivity。 對於包含計時器的工作流程,會 SqlWorkflowPersistenceService 記錄該工作流程下一個計時器到期的時間。 它 SqlWorkflowPersistenceService 會定期輪詢資料庫,尋找計時器已過期的工作流程。 輪詢間隔的頻率可以透過建構器或設定檔設定 SqlWorkflowPersistenceService

Note

在工作流程應用程式中使用 和 SqlTrackingServiceSqlWorkflowPersistenceService ,建議同時使用單一資料庫來進行持久化與追蹤。

建構函式

名稱 Description
SqlWorkflowPersistenceService(NameValueCollection)
已淘汰.

使用指定的參數初始化該類別的新 SqlWorkflowPersistenceService 實例。

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

使用資料庫連接字串及其他參數初始化 SqlWorkflowPersistenceService 類別的新實例。

SqlWorkflowPersistenceService(String)
已淘汰.

利用資料庫連接字串初始化 SqlWorkflowPersistenceService 類別的新實例。

屬性

名稱 Description
EnableRetries
已淘汰.

取得或設定一個值,指定重試是否 SqlWorkflowPersistenceService 提交工作批次。

LoadingInterval
已淘汰.

讀取載入間隔的長度。

Runtime
已淘汰.

為了這項服務,他得到了。WorkflowRuntime

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

取得服務實例識別碼。

State
已淘汰.

取得 的狀態 WorkflowRuntimeService

(繼承來源 WorkflowRuntimeService)

方法

名稱 Description
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)
已淘汰.

解鎖對指定工作流程實例狀態的存取權限。

明確介面實作

名稱 Description
IPendingWork.Commit(Transaction, ICollection)
已淘汰.

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

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

完成工作批次並釋放所有資源。

IPendingWork.MustCommit(ICollection)
已淘汰.

回傳一個值,指示序列化狀態物件的集合是否應該寫入資料庫。

適用於