WorkflowRuntime.RemoveService(Object) WorkflowRuntime.RemoveService(Object) WorkflowRuntime.RemoveService(Object) WorkflowRuntime.RemoveService(Object) Method

정의

워크플로 런타임 엔진에서 지정된 서비스를 제거합니다.Removes the specified service from the workflow run-time engine.

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

매개 변수

service
Object Object Object Object

제거할 서비스를 나타내는 개체입니다.An object that represents the service to remove.

예외

service이 null 참조(Visual Basic의 경우 Nothing)인 경우service is a null reference (Nothing in Visual Basic).

워크플로 런타임 엔진이 시작되었고(IsStartedtrue인 경우) service가 핵심 서비스인 경우The workflow run-time engine has started (IsStarted is true) and service is a core service.

또는-or- service가 워크플로 런타임 엔진에 등록되지 않은 경우service is not registered with the workflow run-time engine.

예제

다음 예제에서는 SqlWorkflowPersistenceServiceWorkflowRuntime에 추가 및 제거합니다.In the following example, a SqlWorkflowPersistenceService is added and removed from the WorkflowRuntime.

// 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).You cannot remove a core service while the workflow run-time engine is running (IsStarted is true). 핵심 서비스는 WorkflowSchedulerService 클래스, WorkflowCommitWorkBatchService 클래스, WorkflowPersistenceService 클래스 및 TrackingService 클래스에서 파생된 서비스입니다.Core services are services that derive from the WorkflowSchedulerService class, the WorkflowCommitWorkBatchService class, the WorkflowPersistenceService class, or the TrackingService class. serviceWorkflowRuntimeService 클래스에서 파생되는 경우 RemoveServiceStop가 구현하는 service 메서드를 호출합니다.If service derives from the WorkflowRuntimeService class, RemoveService calls the Stop method implemented by service.

적용 대상