Get Single Process Variable

Retrieves a variable of a given process instance.

Method

GET /process-instance/{id}/variables/{varId}

Parameters

Path Parameters

Name Description
id The id of the process instance to retrieve the variable from.
varId The name of the variable to get.

Query Parameters

Name Description
deserializeValue 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 object with the following properties:

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.

Response Codes

Code Media type Description
200 application/json Request successful.
404 application/json Variable with given id does not exist. See the Introduction for the error response format.

Example 1

Request

GET /process-instance/aProcessInstanceId/variables/aVarName

Response

{
  "value" : {"prop1" : "a", "prop2" : "b"},
  "type" : "Object",
  "valueInfo" : {
    "objectTypeName": "com.example.MyObject",
    "serializationDataFormat": "application/xml"
  }
}

Example 2

Request

GET /process-instance/aProcessInstanceId/variables/aVarName?deserializeValue=false

Response

{
  "value" : "ab",
  "type" : "Object",
  "valueInfo" : {
    "objectTypeName": "com.example.MyObject",
    "serializationDataFormat": "application/xml"
  }
}

On this Page: