Get Historic Activity Instances (POST)
Queries for historic activity instances that fulfill the given parameters.
Method
POST /history/activity-instance
Parameters
Query Parameters
firstResult | Pagination of results. Specifies the index of the first result to return. |
maxResults | Pagination of results. Specifies the maximum number of results to return. Will return less results if there are no more results left. |
Request Body
A JSON object with the following properties:
Name | Description | ||||||
---|---|---|---|---|---|---|---|
activityInstanceId | Filter by activity instance id. | ||||||
processInstanceId | Filter by process instance id. | ||||||
processDefinitionId | Filter by process definition id. | ||||||
executionId | Filter by the id of the execution that executed the activity instance. | ||||||
activityId | Filter by the activity id (according to BPMN 2.0 XML). | ||||||
activityName | Filter by the activity name (according to BPMN 2.0 XML). | ||||||
activityType | Filter by activity type. | ||||||
taskAssignee | Only include activity instances that are user tasks and assigned to a given user. | ||||||
finished | Only include finished activity instances. Value may only be true , as false behaves the same as when the property is not set. |
||||||
unfinished | Only include unfinished activity instances. Value may only be true , as false
behaves the same as when the property is not set. |
||||||
canceled | Only include canceled activity instances. Value may only be true , as false behaves
the same as when the property is not set. |
||||||
completeScope | Only include activity instances which completed a scope. Value may only be true , as false
behaves the same as when the property is not set. |
||||||
startedBefore | Restrict to instances that were started before the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ , e.g., 2013-01-23T14:42:45.000+0200 . |
||||||
startedAfter | Restrict to instances that were started after the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ , e.g., 2013-01-23T14:42:45.000+0200 . |
||||||
finishedBefore | Restrict to instances that were finished before the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ , e.g., 2013-01-23T14:42:45.000+0200 . |
||||||
finishedAfter | Restrict to instances that were finished after the given date. By default*, the date must have the format yyyy-MM-dd'T'HH:mm:ss.SSSZ , e.g., 2013-01-23T14:42:45.000+0200 . |
||||||
tenantIdIn | Filter by a list of tenant ids. An activity instance must have one of the given tenant ids. Must be a JSON array of Strings. | ||||||
sorting |
A JSON array of criteria to sort the result by. Each element of the array is a JSON object that specifies one ordering. The position in the array identifies the rank of an ordering, i.e., whether it is primary, secondary, etc. The ordering objects have the following properties:
|
* For further information, please see the documentation.
Result
A JSON array of historic activity instance objects. Each historic activity instance object has the following properties:
Name | Value | Description |
---|---|---|
id | String | The id of the activity instance. |
parentActivityInstanceId | String | The id of the parent activity instance, for example a sub process instance. |
activityId | String | The id of the activity that this object is an instance of. |
activityName | String | The name of the activity that this object is an instance of. |
activityType | String | The type of the activity that this object is an instance of. |
processDefinitionKey | String | The key of the process definition that this activity instance belongs to. |
processDefinitionId | String | The id of the process definition that this activity instance belongs to. |
processInstanceId | String | The id of the process instance that this activity instance belongs to. |
executionId | String | The id of the execution that executed this activity instance. |
taskId | String | The id of the task that is associated to this activity instance. Is only set if the activity is a user task. |
assignee | String | The assignee of the task that is associated to this activity instance. Is only set if the activity is a user task. |
calledProcessInstanceId | String | The id of the called process instance. Is only set if the activity is a call activity and the called instance a process instance. |
calledCaseInstanceId | String | The id of the called case instance. Is only set if the activity is a call activity and the called instance a case instance. |
startTime | String | The time the instance was started. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ . |
endTime | String | The time the instance ended. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ . |
durationInMillis | Number | The time the instance took to finish (in milliseconds). |
canceled | Boolean | If true, this activity instance is canceled. |
completeScope | Boolean | If true, this activity instance did complete a BPMN 2.0 scope. |
tenantId | String | The tenant id of the activity instance. |
removalTime | String | The time after which the activity instance should be removed by the History Cleanup job. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ . |
rootProcessInstanceId | String | The process instance id of the root process instance that initiated the process containing this activity instance. |
* For further information, please see the documentation.
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | Returned if some of the query parameters are invalid, for example if a sortOrder parameter is supplied, but no sortBy . See the Introduction for the error response format. |
Example
Request
POST /history/activity-instance
Request Body:
{
"activityType": "userTask",
"taskAssignee": "peter",
"sorting":
[{"sortBy": "activityId",
"sortOrder": "asc"
},
{"sortBy": "executionId",
"sortOrder": "desc"
}]
}
Response
[
{
"activityId": "anActivity",
"activityName": "anActivityName",
"activityType": "userTask",
"assignee": "peter",
"calledProcessInstanceId": "aHistoricCalledProcessInstanceId",
"calledCaseInstanceId": null,
"canceled": true,
"completeScope": false,
"durationInMillis": 2000,
"endTime": "2013-04-23T18:42:43.000+0200",
"executionId": "anExecutionId",
"id": "aHistoricActivityInstanceId",
"parentActivityInstanceId": "aHistoricParentActivityInstanceId",
"processDefinitionId": "aProcDefId",
"processInstanceId": "aProcInstId",
"startTime": "2013-04-23T11:20:43.000+0200",
"taskId": "aTaskId",
"tenantId":null,
"removalTime":"2018-02-10T14:33:19.000+0200",
"rootProcessInstanceId": "aRootProcessInstanceId"
}
]