Terminate Process Instance¶
Terminate a process instance.
Request Format¶
POST https://{apigw-address}/enos-bpm-service/v2.0/work/process-instances?action=delete
Request Parameters (Header)¶
Name |
Location |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
Authorization |
Header |
Mandatory |
String |
The access token, which is represented by the bearer token. It can be obtained by invoking the Log In or Refresh Access Token API. |
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
processInstanceId |
Query |
Mandatory |
String |
The process instance ID. |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
deleteReason |
Mandatory |
String |
The reason for terminating the process instance. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Boolean |
Whether the process instance is terminated successfully. |
Error Codes¶
Code |
Description |
---|---|
33403 |
The current user does not have the permission to terminate this process instance. |
33404 |
The process instance ID does not exist. |
33500 |
Internal service error. |
Samples¶
Request Sample¶
url: https://{apigw-address}/enos-bpm-service/v2.0/work/process-instances?action=delete&processInstanceId={your_process_instance_id}
method: POST
headers: {"Authorization":"Bearer {your_access_token}"}
requestBody: {
"terminateReason": "your_terminate_reason"
}
Return Sample¶
{
"code": 0,
"msg": "",
"data": true
}
Java SDK Sample¶
public class BpmSdkTest{
@Test
public void terminateProcessInstanceTest() {
String bearerToken = "your_bearer_token";
String processInstanceId = "process_instance_id";
String terminateReason = "your_process_terminate_reason";
ProcessInstanceTerminateRequest request = new ProcessInstanceTerminateRequest(processInstanceId,
terminateReason, bearerToken);
ProcessInstanceTerminationResponse response = Poseidon.config(PConfig.init().appKey("your_access_key")
.appSecret("your_secret_key").debug()).url("https://{apigw-address}")
.getResponse(request, ProcessInstanceTerminationResponse.class);
assertNotNull("response cannot be null", response);
}
}