Get Variable Instances

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

Method

GET /history/variable-instance

Parameters

Query Parameters

Name Description
variableName Filter by variable name.
variableNameLike Restrict to variables with a name like the parameter.
variableValue Filter by variable value. Is treated as a String object on server side.
variableTypeIn Only include historic variable instances which belong to one of the passed and comma-separated variable types.
processInstanceId Filter by the process instance the variable belongs to.
processInstanceIdIn Only include historic variable instances which belong to one of the passed and comma-separated variable types. A list of all supported variable types can be found here. Note: All non-primitive variables are assoziated with the type "serializable".
executionIdIn Only include historic variable instances which belong to one of the passed and comma-separated execution ids.
caseInstanceId Filter by the case instance the variable belongs to.
caseExecutionIdIn Only include historic variable instances which belong to one of the passed and comma-separated case execution ids.
caseActivityIdIn Only include historic variable instances which belong to one of the passed and comma-separated case activity ids.
taskIdIn Only include historic variable instances which belong to one of the passed and comma-separated task ids.
activityInstanceIdIn Only include historic variable instances which belong to one of the passed and comma-separated activity instance ids.
tenantIdIn Only include historic variable instances which belong to one of the passed and comma-separated tenant ids.
sortBy Sort the results by a given criterion. Valid values are instanceId, variableName 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.
deserializeValues Determines whether serializable variable values (typically variables that store custom Java objects) should be deserialized on server side (default true).

If set to true, a serializable variable will be deserialized on server side and transformed to JSON using Jackson's POJO/bean property introspection feature. Note that this requires the Java classes of the variable value to be on the REST API's classpath.

If set to false, a serializable variable will be returned in its serialized format. For example, a variable that is serialized as XML will be returned as a JSON string containing XML.

Note: While true is the default value for reasons of backward compatibility, we recommend setting this parameter to false when developing web applications that are independent of the Java process applications deployed to the engine.

Result

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

Name Value Description
id String The id of the variable instance.
name String The name of the variable instance.
type String The value type of the variable.
value String/Number/Boolean/Object
Name Value Description
value String / Number / Boolean / Object The variable's value. Value differs depending on the variable's type and on the deserializeValues parameter.
type String The value type of the variable.
valueInfo Object A JSON object containing additional, value-type-dependent properties.

For variables of type Object, the following properties are returned:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.
valueInfo Object A JSON object containing additional, value-type-dependent properties.

For variables of type Object, the following properties are returned:

  • objectTypeName: A string representation of the object's type name.
  • serializationDataFormat: The serialization format used to store the variable.
processDefinitionKey String The key of the process definition the variable instance belongs to.
processDefinitionId String The id of the process definition the variable instance belongs to.
processInstanceId String The process instance id the variable instance belongs to.
executionId String The execution id the variable instance belongs to.
activityInstanceId String The id of the activity instance in which the variable is valid.
caseDefinitionKey String The key of the case definition the variable instance belongs to.
caseDefinitionId String The id of the case definition the variable instance belongs to.
caseInstanceId String The case instance id the variable instance belongs to.
caseExecutionId String The case execution id the variable instance belongs to.
taskId String The id of the task the variable instance belongs to.
tenantId String The id of the tenant that this variable instance belongs to.
errorMessage String An error message in case a Java Serialized Object could not be de-serialized.

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/variable-instance?variableName=my_variable

Response

[
  {
    "id": "someId",
    "name": "my_variable",
    "type": "String",
    "value": "my_value",
    "valueInfo": {},
    "processDefinitionKey": "aVariableInstanceProcDefKey",
    "processDefinitionId": "aVariableInstanceProcDefId",
    "processInstanceId": "aVariableInstanceProcInstId",
    "executionId": "aVariableInstanceExecutionId",
    "activityInstanceId": "aVariableInstanceActivityInstId",
    "caseDefinitionKey": null,
    "caseInstanceId": null,
    "caseExecutionId": null,
    "taskId": null,
    "tenantId": null,
    "errorMessage": null
  }
]

On this Page: