WorkflowControlClient.Cancel(Guid) 方法

定义

取消指定的工作流实例。

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

参数

instanceId
Guid

要取消的工作流实例。

示例

下面的示例演示如何取消 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.Cancel(instanceId);

适用于