TerminateWorkflow

Terminates the specified workflow instance.

Syntax

public void TerminateWorkflow(
	Guid listId,
	int itemId,
	Guid instanceId
)

Parameters

listId
Type: System.Guid

Required. The identifier of the list for the reusable or list workflow instance specified in instanceId. If a site workflow instance is specified in instanceId, set the value of this parameter to Guid.Empty (or 00000000-0000-0000-0000-000000000000).

itemId
Type: System.Int32

Required. The identifier of the list item for the reusable or list workflow instance specified in instanceId. If a site workflow instance is specified in instanceId, set this parameter to zero (0).

instanceId
Type: System.Guid

Required. The identifier of the workflow instance to be terminated.

Example

The following example demonstrates how to use this operation to terminate a workflow instance for a site workflow.

Request

The following SOAP request attempts to terminate a workflow instance for a site workflow.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
   xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:TerminateWorkflow>
         <nin:listId>00000000-0000-0000-0000-000000000000</nin:listId>
         <nin:itemId>0</nin:itemId>
         <nin:instanceId>4f3d251f-3e3d-4065-8784-8d698868f429</nin:instanceId>
      </nin:TerminateWorkflow>
   </soap:Body>
</soap:Envelope>

Response

The following SOAP response indicates that the workflow instance was successfully terminated.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <TerminateWorkflowResponse xmlns="http://nintex.com"/>
   </soap:Body>
</soap:Envelope>

See Also

Concepts

Workflows

Operations

Terminating workflows

Managing workflow execution

Reference

TerminateWorkflowByName

TerminateWorkflowByNameForListItem

Web Service Reference