Hi,
With Camunda 7.10 I observed the following abnormality when cancelling an activity with REST API:
If I cancel an activity using its activityId
like:
POST http://localhost:8800/engine-rest/process-instance/6deeadb0-b678-11e9-b5bb-0242ac110002/modification
{
"instructions": [
{"type": "cancel", "activityId": "ApproveOrder"},
{"type": "startBeforeActivity", "activityId": "GenerateReconciliation"}]
}
The activity history shows that the activity is ended and cancelled:
{ "id": "ApproveOrder:d1bd8b54-b680-11e9-b5bb-0242ac110002", "parentActivityInstanceId": "6deeadb0-b678-11e9-b5bb-0242ac110002", "activityId": "ApproveOrder", "activityName": "审核订单", "activityType": "userTask", "processDefinitionKey": "worktop", "processDefinitionId": "worktop:34:a47c6556-a70d-11e9-b5bb-0242ac110002", "processInstanceId": "6deeadb0-b678-11e9-b5bb-0242ac110002", "executionId": "6deeadb0-b678-11e9-b5bb-0242ac110002", "taskId": "d1bd8b55-b680-11e9-b5bb-0242ac110002", "calledProcessInstanceId": null, "calledCaseInstanceId": null, "assignee": null, "startTime": "2019-08-04T06:26:40.244+0000", "endTime": "2019-08-09T09:41:54.886+0000", "durationInMillis": 443714642, "canceled": true, "completeScope": false, "tenantId": null, "removalTime": null, "rootProcessInstanceId": "6deeadb0-b678-11e9-b5bb-0242ac110002" }
But if the activity is cancelled using its activityInstanceId
:
POST http://localhost:8800/engine-rest/process-instance/4b1fb0e5-b06e-11e9-b5bb-0242ac110002/modification
{
"instructions": [
{"type": "cancel", "activityInstanceId": "ApproveOrder:9be7d130-ba88-11e9-b86b-0242ac110007"},
{"type": "startBeforeActivity", "activityId": "GenerateReconciliation"}]
}
The activity instance history remain unchanged, i.e. neither endTime
is set nor canceled
is set to true:
{
“id”: “ApproveOrder:9be7d130-ba88-11e9-b86b-0242ac110007”,
“parentActivityInstanceId”: “4b1fb0e5-b06e-11e9-b5bb-0242ac110002”,
“activityId”: “ApproveOrder”,
“activityName”: “审核订单”,
“activityType”: “userTask”,
“processDefinitionKey”: “worktop”,
“processDefinitionId”: “worktop:34:a47c6556-a70d-11e9-b5bb-0242ac110002”,
“processInstanceId”: “4b1fb0e5-b06e-11e9-b5bb-0242ac110002”,
“executionId”: “4b1fb0e5-b06e-11e9-b5bb-0242ac110002”,
“taskId”: “9be7d131-ba88-11e9-b86b-0242ac110007”,
“calledProcessInstanceId”: null,
“calledCaseInstanceId”: null,
“assignee”: null,
“startTime”: “2019-08-09T09:32:30.549+0000”,
“endTime”: null,
“durationInMillis”: null,
“canceled”: false,
“completeScope”: false,
“tenantId”: null,
“removalTime”: null,
“rootProcessInstanceId”: “4b1fb0e5-b06e-11e9-b5bb-0242ac110002”
}
I wonder whether this is a bug or there are some special reasons for this behavior?