WorkflowControlClient.Abandon Method

Definition

Abandons a workflow instance.

Overloads

Abandon(Guid)

Abandons the specified workflow instance.

Abandon(Guid, String)

Abandons the specified workflow instance.

Abandon(Guid)

Abandons the specified workflow instance.

C#
public void Abandon(Guid instanceId);

Parameters

instanceId
Guid

The workflow instance to abandon.

Examples

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

C#
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.Abandon(instanceId);

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Abandon(Guid, String)

Abandons the specified workflow instance.

C#
public void Abandon(Guid instanceId, string reason);

Parameters

instanceId
Guid

The workflow instance to abandon.

reason
String

The reason to abandon the workflow instance.

Examples

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

C#
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.Abandon(instanceId, "Sample to abandon");

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1