Cancel Process Instance

API Type

REST

HTTP Method

POST

Description

Cancels the process instance based on a specified process instance identifier. This method cancels all automatic work items, manual work items, and child process instances.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Workflow/CancelProcInst/[processInstanceID]

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Workflow/CancelProcInst/[processInstanceID]

Request Parameters

Name Description

processInstanceID

Definition:
Specifies the unique ID of a process instance.
Type
string
Allowed Values:
A valid process instance ID

JavaScript Code Example

$("#btnCancelProcInst").click(function () {

  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/
                CancelProcInst/248685A175F54C12A9A80353798B4508",
  });

});

Java Code Example

public String CancelProcessInstance(String processInstanceID) {

  String URI = "http://mydomain:9011/AgilePointServer/Workflow/CancelProcInst/"
                       + processInstanceID;

  HTTPOperations ops = new HTTPOperations(domain, this.userName,
                       password, appID, locale);

  JSONObject postData = new JSONObject();
  return ops.POSTMethod(URI, postData.toString());
}

C# Code Example

public string CancelProcInst()
  {
    string URI = "http://mydomain:9011/AgilePointServer/Workflow/
                         CancelProcInst/62D52F1FAF334A24B501B727754F5959";

    HTTPOperations ops = new HTTPOperations(domain, this.userName, 
                         password, appID, locale);

    return ops.POSTMethod(URI, "");
  }

Output

WFEvent object that provides the status of the transaction. The possible statuses are:

  • Sent - Indicates event has been sent to engine for processing.
  • Failed - Indicates event failed to process.
  • Processed - Indicates event has been processed successfully.
  • Canceled - Indicates event was canceled.
  • Deferred - Indicates event does not need to be sent immediately.

JSON Response Body Example

{
  "ActivityInstID": "",
  "AutoStart": true,
  "CustomAttributes": null,
  "Diagnostic": true,
  "EndDate": "\/Date(928149600000+0000)\/",
  "Entries": 1,
  "Error": null,
  "EventID": "B501460A104444C487DEE1B16DD1A7CF",
  "EventName": "CancelProcessInstance",
  "HighPriority": true,
  "ParamsXml": "<?xml version=\"1.0\" encoding=\"utf-8\"?>
                <WFEvent>
                  <param name=\"ProcInstID\" 
                          value=\"355E739A362A46D5B987AEF3951DF9F5\" \/>
                  <param name=\"HighPriority\" value=\"True\" \/>
                <\/WFEvent>",
  "ParentProcInstID": "",
  "ProcDefID": "",
  "ProcInstID": "355E739A362A46D5B987AEF3951DF9F5",
  "ProcInstName": "",
  "Sender": "demo3\\administrator",
  "SentDate": "\/Date(1394137494815+0000)\/",
  "SourceWorkItemID": "",
  "Status": "Sent",
  "UserID": "",
  "WorkItemID": "",
  "WorkObjectID": "",
  "WorkObjectInfo": ""
}

Supported Versions

AgilePoint BPMS v5.0 R2 and higher