WorkflowRuntime.RemoveService(Object) 메서드

정의

워크플로 런타임 엔진에서 지정된 서비스를 제거합니다.

public:
 void RemoveService(System::Object ^ service);
public void RemoveService (object service);
member this.RemoveService : obj -> unit
Public Sub RemoveService (service As Object)

매개 변수

service
Object

제거할 서비스를 나타내는 개체입니다.

예외

service이 null 참조(Visual Basic의 경우 Nothing)인 경우

WorkflowRuntime이 이미 삭제된 경우

워크플로 런타임 엔진이 시작되었고(IsStartedtrue인 경우) service가 핵심 서비스인 경우

또는

service가 워크플로 런타임 엔진에 등록되지 않은 경우

예제

다음 예제에서는 SqlWorkflowPersistenceServiceWorkflowRuntime에 추가 및 제거합니다.

// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Create a new instance of the out-of-box SqlWorkflowPersistenceService
SqlWorkflowPersistenceService persistenceService =
   new SqlWorkflowPersistenceService(
   "Initial Catalog=SqlPersistenceService;Data Source=localhost;Integrated Security=SSPI;");
// Add the service to the runtime
workflowRuntime.AddService(persistenceService);
// Start the runtime
workflowRuntime.StartRuntime();
// Stop the runtime
workflowRuntime.StopRuntime();
// Remove the service from the runtime
workflowRuntime.RemoveService(persistenceService);
' Create a new workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Create a new instance of the out-of-box SqlWorkflowPersistenceService
Dim persistenceService As New SqlWorkflowPersistenceService( _
   "Initial Catalog=SqlPersistenceServiceData Source=localhostIntegrated Security=SSPI")
' Add the service to the runtime
workflowRuntime.AddService(persistenceService)
' Start the runtime
workflowRuntime.StartRuntime()
' Stop the runtime
workflowRuntime.StopRuntime()
' Remove the service from the runtime
workflowRuntime.RemoveService(persistenceService)

설명

워크플로 런타임 엔진이 실행 중일 때에 핵심 서비스를 제거할 수 없습니다 (IsStartedtrue). 핵심 서비스는 WorkflowSchedulerService 클래스, WorkflowCommitWorkBatchService 클래스, WorkflowPersistenceService 클래스 및 TrackingService 클래스에서 파생된 서비스입니다. serviceWorkflowRuntimeService 클래스에서 파생되는 경우 RemoveServiceStop가 구현하는 service 메서드를 호출합니다.

적용 대상