We are running Camunda 7.9.0.
We believe we are seeing an issue where the currently running activity (which in this case is a script task) is not properly shown in the Cockpit, nor is not returned via the REST API when calling GET engine-rest/process-instance/:id/activity-instances.
This can be demonstrated with a very simple model consisting of a user task, followed by a script task (in this case, the script consists of an infinite loop, in order to keep this task active). NOTE: The user task is configured with Asynchronous After enabled.
testAsyncContinue2.bpmn (3.5 KB)
After starting the process and completing the user task, in the Cockpit, on the Processes page, the view of the model shows the token still sitting on the user task, even though the user task has been completed. In the User Tasks tab beneath the model image, no user tasks are listed, which is correct. So this view is inconsistent. See the following screen shot:
When issuing the REST API call GET engine-rest/process-instance/:id/activity-instances, the following is returned:
{
"id": "d46fd003-ac87-11e8-b3b5-0242ac120003",
"parentActivityInstanceId": null,
"activityId": "TestAsync:1:a95480ee-ac87-11e8-b3b5-0242ac120003",
"activityType": "processDefinition",
"processInstanceId": "d46fd003-ac87-11e8-b3b5-0242ac120003",
"processDefinitionId": "TestAsync:1:a95480ee-ac87-11e8-b3b5-0242ac120003",
"childActivityInstances": [],
"childTransitionInstances": [
{
"id": "d46fd003-ac87-11e8-b3b5-0242ac120003",
"parentActivityInstanceId": "d46fd003-ac87-11e8-b3b5-0242ac120003",
"processInstanceId": "d46fd003-ac87-11e8-b3b5-0242ac120003",
"processDefinitionId": "TestAsync:1:a95480ee-ac87-11e8-b3b5-0242ac120003",
"activityId": "Task_15rkevu",
"activityName": "Test Async User Task",
"activityType": "userTask",
"executionId": "d46fd003-ac87-11e8-b3b5-0242ac120003",
"targetActivityId": "Task_15rkevu"
}
],
"executionIds": [
"d46fd003-ac87-11e8-b3b5-0242ac120003"
],
"activityName": "Test Async",
"name": "Test Async"
}
This shows the already completed user task as a current activity. It does not show the script task as a current activity.
As expected, the DB table ACT_RU_TASK does not show any current tasks for this process instance.
Is this expected behavior? Clearly the Cockpit display appears to be inconsistent and the REST endpoint is returning an activity that has been completed. I would expect both to show that the script task is the current activity.
Is there some other REST API call we should be using that would accurately show that the script task is currently executing?