WorkflowControlClient.Suspend Method

Definition

Suspends the specified workflow instance.

Overloads

Suspend(Guid)

Suspends the specified workflow instance.

Suspend(Guid, String)

Suspends the specified workflow instance.

Suspend(Guid)

Suspends the specified workflow instance.

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

Parameters

instanceId
Guid

The workflow instance to suspend.

Examples

The following example shows how to suspend 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.Suspend(instanceId);

Applies to

Suspend(Guid, String)

Suspends the specified workflow instance.

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

Parameters

instanceId
Guid

The workflow instance to suspend.

reason
String

The reason to suspend the workflow instance.

Examples

The following example shows how to suspend 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.Suspend(instanceId, "Sample to suspend");

Applies to