Set valueInfo on case variables

Hello,
I am using the REST API to create case instances and manipulate them. I would like to set the value of the field valueInfo of my variables(which are either String or numeric value). But when trying to do so I got this error:
{
“type”: “JsonMappingException”,
“message”: “Can not instantiate value of type [map type; class java.util.LinkedHashMap, [simple type, class java.lang.String] -> [simple type, class java.lang.Object]] from String value (‘test’); no single-String constructor/factory method\n at [Source: org.camunda.bpm.engine.rest.filter.EmptyBodyFilter$1$1@272ff049; line: 1, column: 58] (through reference chain: org.camunda.bpm.engine.rest.dto.runtime.CreateCaseInstanceDto[“variables”]->java.util.LinkedHashMap[“myTest”]->org.camunda.bpm.engine.rest.dto.VariableValueDto[“valueInfo”])”
}

I am using the POST /case-definition/key/{key}/create method with this body:
{“variables”: {“myTest”: {“value”: null, “type”: “String”,“valueInfo”:“test”}}}

So my question is: Is it possible to set the valueInfo of a caseVariable at caseCreation or later via update Variable ?

1 Like

After some seach, it seems that I wasn’t using the right format for valueInfo, this haw worked with “valueInfo” : {
“objectTypeName” : “com.fasterxml.jackson.databind.node.ArrayNode”,
“serializationDataFormat” : “JSON”
}

1 Like