Get Historic Activity Instances

Queries for historic activity instances that fulfill the given parameters. The size of the result set can be retrieved by using the Get Historic Activity Instance Count method.

Method

GET /history/activity-instance

Parameters

Query Parameters

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 comma-separated list of tenant ids. An activity instance must have one of the given tenant ids.
sortBy Sort the results by a given criterion. Valid values are activityInstanceId, instanceId, executionId, activityId, activityName, activityType, startTime, endTime, duration, definitionId, occurrence and tenantId. 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.
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.

* 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.

* 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

GET /history/activity-instance?activityType=userTask&taskAssignee=peter

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
  }
]

On this Page: