SqlWorkflowPersistenceService 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
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 中的
這個 SqlWorkflowPersistenceService 類別代表一個功能完整的持久化服務。 你可以直接使用此服務,當工作流程執行引擎請求時,持續保存並取得工作流程實例的狀態資訊。
參與SqlWorkflowPersistenceService由 .WorkflowCommitWorkBatchService 也就是說,它會新增代表待處理寫入 SQL 資料庫的物件,WorkBatch並實作介面。IPendingWork
SqlWorkflowPersistenceService支援鎖定工作流程實例。 此功能用於多個工作流程執行時共用同一資料庫。 SQL 資料庫資料表中的欄位用於在工作流執行時標記該工作流實例為鎖定狀態。 它 SqlWorkflowPersistenceService 不會載入被其他執行時標記為「正在使用」的工作流程實例。 通常這些鎖會在工作流程實例持續存在時解除,例如在閒置、完成或終止時。 鎖也可以在一段時間內不啟用後自動解除。 這個不活動期間可透過類別的 SqlWorkflowPersistenceService 建構子設定。 也可以透過設定檔設定。
欲了解更多關於持久化服務的資訊,請參閱該 WorkflowPersistenceService 類別。
工作流程實例可以包含計時器,例如如果它們有 DelayActivity。 對於包含計時器的工作流程,會 SqlWorkflowPersistenceService 記錄該工作流程下一個計時器到期的時間。 它 SqlWorkflowPersistenceService 會定期輪詢資料庫,尋找計時器已過期的工作流程。 輪詢間隔的頻率可以透過建構器或設定檔設定 SqlWorkflowPersistenceService 。
Note
在工作流程應用程式中使用 和 SqlTrackingService 時 SqlWorkflowPersistenceService ,建議同時使用單一資料庫來進行持久化與追蹤。
建構函式
| 名稱 | 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 |
|---|---|
| IPendingWork.Commit(Transaction, ICollection) |
已淘汰.
將序列化狀態物件的 an ICollection 寫入資料庫。 |
| IPendingWork.Complete(Boolean, ICollection) |
已淘汰.
完成工作批次並釋放所有資源。 |
| IPendingWork.MustCommit(ICollection) |
已淘汰.
回傳一個值,指示序列化狀態物件的集合是否應該寫入資料庫。 |