Get Historic Activity Statistics
Retrieves historic statistics of a given process definition, grouped by activities.
These statistics include the number of running activity instances and, optionally, the number of canceled activity instances, finished activity instances and activity instances which completed a scope (i.e., in BPMN 2.0 manner: a scope is completed by an activity instance when the activity instance consumed a token but did not emit a new token).
Note: This only includes historic data.
Method
GET /history/process-definition/{id}/statistics
Parameters
Path Parameters
Name | Description |
---|---|
id | The id of the process definition. |
Query Parameters
Name | Description |
---|---|
canceled | Whether to include the number of canceled activity instances in the result or not. Valid values are true or false . Default: false . |
finished | Whether to include the number of finished activity instances in the result or not. Valid values are true or false . Default: false . |
completeScope | Whether to include the number of activity instances which completed a scope in the result or not. Valid values are true or false . Default: false . |
incidents | Whether to include the number of incidents. Valid values are true or false . Default: false . |
startedBefore | Restrict to process 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 process 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 process 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 process 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 . |
processInstanceIdIn | Restrict to process instances with the given IDs. The IDs must be provided as a comma-separated list. |
sortBy | Sort the results by a given criterion. A valid value is activityId . Must be used in conjunction with the sortOrder parameter. |
sortOrder | Sort the results in a given order. Values may be asc for ascending order or desc for descending order.
Must be used in conjunction with the sortBy parameter. |
* For further information, please see the documentation.
Result
A JSON array containing statistics results per activity. Each object has the following properties:
Name | Value | Description |
---|---|---|
id | String | The id of the activity the results are aggregated for. |
instances | Number | The total number of all running instances of the activity. |
canceled | Number | The total number of all canceled instances of the activity. Note: Will be 0 (not null ), if canceled activity instances were excluded. |
finished | Number | The total number of all finished instances of the activity. Note: Will be 0 (not null ), if finished activity instances were excluded. |
completeScope | Number | The total number of all instances which completed a scope of the activity. Note: Will be 0 (not null ), if activity instances which completed a scope were excluded. |
openIncidents | Number | The total number of open incident for the activity. Note: Will be 0 (not null ), if incidents is set to false . |
resolvedIncidents | Number | The total number of resolved incident for the activity. Note: Will be 0 (not null ), if incidents is set to false . |
deletedIncidents | Number | The total number of deleted incident for the activity. Note: Will be 0 (not null ), if incidents is set to false . |
Response Codes
Code | Media type | Description |
---|---|---|
200 | application/json | Request successful. |
400 | application/json | Returned if some of the query parameters are invalid. See the Introduction for the error response format. |
Examples
Request With Query Parameter canceled=true
GET history/process-definition/aProcessDefinitionId/statistics?canceled=true
Response
[
{
"id": "anActivity",
"instances": 123,
"canceled": 50,
"finished": 0,
"completeScope": 0,
"openIncidents": 0,
"resolvedIncidents": 0,
"deletedIncidents": 0
},
{
"id":"anotherActivity",
"instances": 200,
"canceled": 150,
"finished": 0,
"completeScope": 0,
"openIncidents": 0,
"resolvedIncidents": 0,
"deletedIncidents": 0
}
]
Request With Query Parameter finished=true
GET history/process-definition/aProcessDefinitionId/statistics?finished=true
Response
[
{
"id": "anActivity",
"instances": 123,
"canceled": 0,
"finished": 20,
"completeScope": 0,
"openIncidents": 0,
"resolvedIncidents": 0,
"deletedIncidents": 0
},
{
"id":"anotherActivity",
"instances": 200,
"canceled": 0,
"finished": 30,
"completeScope": 0,
"openIncidents": 0,
"resolvedIncidents": 0,
"deletedIncidents": 0
}
]
Request With Query Parameter completeScope=true
GET history/process-definition/aProcessDefinitionId/statistics?completeScope=true
Response
[
{
"id": "anActivity",
"instances": 123,
"canceled": 0,
"finished": 0,
"completeScope": 20,
"openIncidents": 0,
"resolvedIncidents": 0,
"deletedIncidents": 0
},
{
"id":"anotherActivity",
"instances": 200,
"canceled": 0,
"finished": 0,
"completeScope": 1,
"openIncidents": 0,
"resolvedIncidents": 0,
"deletedIncidents": 0
}
]