Get Variable Instances (POST)

Queries for historic variable instances that fulfill the given parameters. This method is slightly more powerful than the Get Variable Instances method because it allows filtering by variable values of the different types String, Number or Boolean.

Method

POST /history/variable-instance

Parameters

Query Parameters

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.

Request Body

A JSON object with the following properties:

Name Description
variableName Filter by variable name.
variableNameLike Restrict to variables with a name like the parameter.
variableValue Filter by variable value. May be String, Number or Boolean.
variableNamesIgnoreCase Match the variable name provided in variableName and variableNameLike case-insensitively. If set to true variableName and variablename are treated as equal.
variableValuesIgnoreCase Match the variable value provided in variableValue case-insensitively. If set to true variableValue and variablevalue are treated as equal.
variableTypeIn 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 associated with the type "serializable".
includeDeleted Include variables that has already been deleted during the execution.
processInstanceId Filter by the process instance the variable belongs to.
processInstanceIdIn Only include historic variable instances which belong to one of the passed process instance ids.
processDefinitionId Filter by the process definition the variable belongs to.
processDefinitionKey Filter by a key of the process definition the variable belongs to.
executionIdIn Only include historic variable instances which belong to one of the passed 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 case execution ids.
caseActivityIdIn Only include historic variable instances which belong to one of the passed case activity ids.
taskIdIn Only include historic variable instances which belong to one of the passed task ids.
activityInstanceIdIn Only include historic variable instances which belong to one of the passed activity instance ids.
tenantIdIn Only include historic variable instances which belong to one of the passed and comma-separated tenant ids.
withoutTenantId Only include historic variable instances that belong to no tenant. Value may only be true, as false is the default behavior.
sorting A JSON array of criteria to sort the result by. Each element of the array is a JSON object that specifies one ordering. The position in the array identifies the rank of an ordering, i.e., whether it is primary, secondary, etc. The ordering objects have the following properties:
Name Description
sortBy Mandatory. Sort the results lexicographically by a given criterion. Valid values are instanceId and variableName and tenantId.
sortOrder Mandatory. Sort the results in a given order. Values may be asc for ascending order or desc for descending order.

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 The variable's value. Value differs depending on the variable's type and on the deserializeValues parameter.
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 id the process instance belongs to.
executionId String The id of the execution 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 id of the case instance the variable instance belongs to.
caseExecutionId String The id of the case execution 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.
state String The current state of the variable. Can be 'CREATED' or 'DELETED'.
createTime String The time the variable was inserted. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
removalTime String The time after which the variable should be removed by the History Cleanup job. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
rootProcessInstanceId String The process instance id of the root process instance that initiated the process containing this variable.

* 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

POST /history/variable-instance

Request Body:

{
  "variableName": "someVariable",
  "variableValue": 42,
  "sorting":
    [{"sortBy": "variableName",
    "sortOrder": "asc"
    },
    {"sortBy": "instanceId",
    "sortOrder": "desc"
    }]
}

Response

[
  {
    "id": "someId",
    "name": "someVariable",
    "type": "Integer",
    "variableType": "integer",
    "value": 5,
    "valueInfo": {},
    "processDefinitionKey": "aProcessDefinitionKey",
    "processDefinitionId": "aProcessDefinitionId",
    "processInstanceId": "aProcInstId",
    "executionId": "aExecutionId",
    "activityInstanceId": "aActivityInstId",
    "caseDefinitionKey": null,
    "caseDefinitionId": null,
    "caseInstanceId": null,
    "caseExecutionId": null,
    "taskId": null,
    "tenantId": null,
    "errorMessage": null,
    "state": "CREATED",
    "createTime":"2017-02-10T14:33:19.000+0200",
    "removalTime": "2018-02-10T14:33:19.000+0200",
    "rootProcessInstanceId": "aRootProcessInstanceId"
  }
]

目录: