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.
finished Whether to include the number of finished activity instances in the result or not. Valid values are true or 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.
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.

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.

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
  },
  {
    "id":"anotherActivity",
    "instances": 200,
    "canceled": 150,
    "finished": 0,
    "completeScope": 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
  },
  {
    "id":"anotherActivity",
    "instances": 200,
    "canceled": 0,
    "finished": 30,
    "completeScope": 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
  },
  {
    "id":"anotherActivity",
    "instances": 200,
    "canceled": 0,
    "finished": 0,
    "completeScope": 1
  }
]

On this Page: