WorkflowRuntimeService 類別

定義

警告

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

表示抽象基底類別,工作流程執行階段引擎核心服務由此衍生。

public ref class WorkflowRuntimeService abstract
public abstract class WorkflowRuntimeService
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public abstract class WorkflowRuntimeService
type WorkflowRuntimeService = class
[<System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")>]
type WorkflowRuntimeService = class
Public MustInherit Class WorkflowRuntimeService
繼承
WorkflowRuntimeService
衍生
屬性

備註

注意

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

工作流程執行階段引擎可以啟動和停止衍生自 WorkflowRuntimeService 類別的服務。 然而服務啟動或停止的順序是不確定的。服務可能需要其他服務的支援才可以在啟動時將自己本身正常初始化,相對的,服務也可能需要其他服務的支援才能在停止時正常關閉。 為了解決這個問題,工作流程執行階段引擎提供用於啟動和停止服務的兩階段機制。 呼叫 StartRuntime 時,工作流程執行階段引擎會為每個衍生自 Start 類別的服務叫用 WorkflowRuntimeService 方法。 啟動所有這些服務後,工作流程執行階段引擎會引發 WorkflowRuntime.Started 事件,從而為每個工作流程執行階段引擎服務叫用 OnStarted 方法。 您的服務可以覆寫 OnStarted 方法以參與這個兩階段的過程。 同樣地,當呼叫 StopRuntime 時,Stop 方法、WorkflowRuntime.Stopped 事件和 OnStopped 方法會提供這個兩階段機制。 State 屬性包含 WorkflowRuntimeServiceState 值,該值表示服務正在啟動或停止中,或是已完全啟動或停止。

衍生自 WorkflowRuntimeService 類別的服務在遇到造成未處理例外狀況的情況時,可以透過呼叫 WorkflowRuntime.ServicesExceptionNotHandled 來引發 RaiseServicesExceptionNotHandledEvent 事件。

衍生自 WorkflowSchedulerService 類別、WorkflowCommitWorkBatchService 類別、WorkflowPersistenceService 類別和 TrackingService 類別的服務,最終都是衍生自 WorkflowRuntimeService 類別。

建構函式

WorkflowRuntimeService()
已淘汰.

在衍生類別中實作時,初始化 WorkflowRuntimeService 類別的新執行個體。

屬性

Runtime
已淘汰.

取得此服務的 WorkflowRuntime

State
已淘汰.

取得 WorkflowRuntimeService 的狀態。

方法

Equals(Object)
已淘汰.

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

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

做為預設雜湊函式。

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

取得目前執行個體的 Type

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

建立目前 Object 的淺層複製。

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

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

OnStopped()
已淘汰.

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

RaiseServicesExceptionNotHandledEvent(Exception, Guid)
已淘汰.

引發 ServicesExceptionNotHandled 事件。

Start()
已淘汰.

在衍生類別中覆寫時,啟動服務並將 State 變更為 Starting

Stop()
已淘汰.

在衍生類別中覆寫時,停止服務並將 State 變更為 Stopping

ToString()
已淘汰.

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

(繼承來源 Object)

適用於