Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WorkflowControlClient::Terminate Method (Guid, String^)

.NET Framework (current version)
 

Terminates the specified workflow instance with the specified reason.

Namespace:   System.ServiceModel.Activities
Assembly:  System.ServiceModel.Activities (in System.ServiceModel.Activities.dll)

public:
void Terminate(
	Guid instanceId,
	String^ reason
)

Parameters

instanceId
Type: System::Guid

The workflow instance to terminate.

reason
Type: System::String^

The reason to terminate the workflow instance.

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");

.NET Framework
Available since 4.0
Return to top
Show:
© 2017 Microsoft