Spin deserialization in REST API

Hi all,
We have configured Spin with JSON.

  1. The following String is written as JSON to a process variable:
    { “formFields”: [ { “fieldId”: “gridData”, “type”: “string” }, { “fieldId”: “inputField”, “label”: “Description”, “type”: “string”, “maxlength”: “50” } ]}

  2. Like this:
    JsonValue jsonValue = SpinValues.jsonValue(jsonString).serializationDataFormat(“application/json”).create();
    delegateTask.setVariable(taskName.concat(“_”).concat(taskInstanceId), jsonValue);

  3. After starting the process engine we are able to see the JSON in the Cockpit-Variables tab but when trying to retrieve the JSON using /variable-instance REST API, we see this:

    “type”: “Json”,
    “value”: {
    “array”: false,
    “null”: false,
    “nodeType”: “OBJECT”,
    “value”: false,
    “boolean”: false,
    “object”: true,
    “number”: false,
    “string”: false,
    “dataFormatName”: “application/json”
    “valueInfo”: {},
    “id”: “0a9f1dfb-373e-11e8-9c44-309c2313e693”,
    “name”: “Form_0a97caf7-373e-11e8-9c44-309c2313e693”,
    “processInstanceId”: “0a922597-373e-11e8-9c44-309c2313e693”,
    “executionId”: “0a922597-373e-11e8-9c44-309c2313e693”,
    “caseInstanceId”: null,
    “caseExecutionId”: null,
    “taskId”: null,
    “activityInstanceId”: “0a922597-373e-11e8-9c44-309c2313e693”,
    “errorMessage”: null,
    “tenantId”: null

DeserializeValues=true/false does not change the response we get. How to get the JSON in the REST API response? We are using Camunda 7.8.0 with SpringBoot.

Paul Palacean

I was able to get the JSON by using a different API: /form-variables?deserializeValues=false

I’m having a similar problem in the response body of /external-task/fetchAndLock: when the retrieved variable is of type “Json”, value.value is false if deserializeValues has been set to false. If I set it to true, value.value is the stringified JSON. Tested on 7.10.0.