แก้ไข

แชร์ผ่าน


WorkflowControlClient.Terminate Method

Definition

Terminates the specified workflow instance.

Overloads

Terminate(Guid)

Terminates the specified workflow instance.

Terminate(Guid, String)

Terminates the specified workflow instance with the specified reason.

Terminate(Guid)

Terminates the specified workflow instance.

public:
 void Terminate(Guid instanceId);
public void Terminate (Guid instanceId);
member this.Terminate : Guid -> unit
Public Sub Terminate (instanceId As Guid)

Parameters

instanceId
Guid

The workflow instance to terminate.

Examples

The following example shows how to terminate a workflow instance with the WorkflowControlClient.

IWorkflowCreation creationClient = new ChannelFactory<IWorkflowCreation>(new BasicHttpBinding(), "http://localhost/DataflowControl.xaml/Creation").CreateChannel();
Guid instanceId = creationClient.CreateSuspended(null);
WorkflowControlClient controlClient = new WorkflowControlClient(
    new BasicHttpBinding(),
    new EndpointAddress(new Uri("http://localhost/DataflowControl.xaml")));

controlClient.Unsuspend(instanceId);

// ...

controlClient.Terminate(instanceId);

Applies to

Terminate(Guid, String)

Terminates the specified workflow instance with the specified reason.

public:
 void Terminate(Guid instanceId, System::String ^ reason);
public void Terminate (Guid instanceId, string reason);
member this.Terminate : Guid * string -> unit
Public Sub Terminate (instanceId As Guid, reason As String)

Parameters

instanceId
Guid

The workflow instance to terminate.

reason
String

The reason to terminate the workflow instance.

Examples

The following example shows how to terminate a workflow instance with the WorkflowControlClient.

IWorkflowCreation creationClient = new ChannelFactory<IWorkflowCreation>(new BasicHttpBinding(), "http://localhost/DataflowControl.xaml/Creation").CreateChannel();
Guid instanceId = creationClient.CreateSuspended(null);
WorkflowControlClient controlClient = new WorkflowControlClient(
    new BasicHttpBinding(),
    new EndpointAddress(new Uri("http://localhost/DataflowControl.xaml")));

controlClient.Unsuspend(instanceId);

// ...

controlClient.Terminate(instanceId, "Sample to terminate");

Applies to