Get Case Instances

Query for historic case instances that fulfill the given parameters. The size of the result set can be retrieved by using the get historic case instances count method.

Method

GET /history/case-instance

Parameters

Query Parameters

Name Description
caseInstanceId Filter by case instance id.
caseInstanceIds Filter by case instance ids. Must be a comma-separated list of case instance ids.
caseDefinitionId Filter by the case definition the instances run on.
caseDefinitionKey Filter by the key of the case definition the instances run on.
caseDefinitionKeyNotIn Exclude instances that belong to a set of case definitions. Must be a comma-separated list of case definition keys.
caseDefinitionName Filter by the name of the case definition the instances run on.
caseDefinitionNameLike Filter by case definition names that the parameter is a substring of.
caseInstanceBusinessKey Filter by case instance business key.
caseInstanceBusinessKeyLike Filter by case instance business key that the parameter is a substring of.
createdBefore Restrict to instances that were created before the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
createdAfter Restrict to instances that were created after the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
closedBefore Restrict to instances that were closed before the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
closedAfter Restrict to instances that were closed after the given date. The date must have the format yyyy-MM-dd'T'HH:mm:ss, e.g., 2013-01-23T14:42:45.
createdBy Only include case instances that were created by the given user.
superCaseInstanceId Restrict query to all case instances that are sub case instances of the given case instance. Takes a case instance id.
subCaseInstanceId Restrict query to one case instance that has a sub case instance with the given id.
superProcessInstanceId Restrict query to all case instances that are sub case instances of the given process instance. Takes a process instance id.
subProcessInstanceId Restrict query to one case instance that has a sub process instance with the given id.
active Only include active case instances. Value may only be true, as false is the default behavior.
completed Only include completed case instances. Value may only be true, as false is the default behavior.
terminated Only include terminated case instances. Value may only be true, as false is the default behavior.
closed Only include closed case instances. Value may only be true, as false is the default behavior.
notClosed Only include not closed case instances. Value may only be true, as false is the default behavior.
variables Only include process instances that have/had variables with certain values. Variable filtering expressions are comma-separated and are structured as follows:
A valid parameter value has the form key_operator_value. key is the variable name, operator is the comparison operator to be used and value the variable value.
Note: Values are always treated as String objects on server side.

Valid operator values are: eq - equal to; neq - not equal to; gt - greater than; gteq - greater than or equal to; lt - lower than; lteq - lower than or equal to; like.
key and value may not contain underscore or comma characters.
sortBy Sort the results by a given criterion. Valid values are instanceId, definitionId, businessKey, createTime, closeTime, duration. 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.

Result

A JSON array of historic case instance objects. Each historic case instance object has the following properties:

Name Value Description
id String The id of the case instance.
businessKey String The business key of the case instance.
caseDefinitionId String The id of the case definition that this case instance belongs to.
createTime String The time the instance was created. Has the format yyyy-MM-dd'T'HH:mm:ss.
closeTime String The time the instance was closed. Has the format yyyy-MM-dd'T'HH:mm:ss.
durationInMillis Number The time the instance took to finish (in milliseconds).
createUserId String The id of the user who created the case instance.
superCaseInstanceId String The id of the parent case instance, if it exists.
superProcessInstanceId String The id of the parent process instance, if it exists.
active Boolean If true, this case instance is active.
completed Boolean If true, this case instance is completed.
terminated Boolean If true, this case instance is terminated.
closed Boolean If true, this case instance is closed.

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/case-instance?closedAfter=2013-01-01T00:00:00&closedBefore=2013-04-01T23:59:59

Response

[
  {
    "id": "aCaseInstId",
    "businessKey": "aKey",
    "caseDefinitionId": "aCaseDefId",
    "createTime": "2013-03-23T13:42:43",
    "closeTime": "2013-03-23T13:42:45",
    "durationInMillis": 2000,
    "createUserId": "aStartUserId",
    "superCaseInstanceId": "aSuperCaseInstanceId",
    "superProcessInstanceId": null,
    "active": true,
    "completed": false,
    "terminated": false,
    "closed": false
  }
]

On this Page: