How to deserialize the value of a json variable If the variable is obtained through a custom query of mybatis.
I mapped the ACT_HI_VARINSTANCE table to my dto.
Here is the DTO
@Data
public class Variable {
private String name;
private String processDefinitionKey;
private String processInstanceId;
private String textValue1;
private String textValue2;
private Long longValue;
private Double doubleValue;
private String variableType;
private Integer rev;
private String executionId;
private Timestamp createdAt;
private String byteArrayId;
}
If set a ObjectValue as json format and set it into the process instance as a variable. The value of that variable will saved at the BYTEARRAY_ID
column of the ACT_HI_VARINSTANC
table.
The code looks like below
String json = "{\"name\" : \"jonny\","
+ "\"address\" : {"
+ "\"street\" : \"12 High Street\","
+ "\"post code\" : 1234"
+ "}"
+ "}";
JsonValue jsonValue = SpinValues.jsonValue(json).create();
execution.setVariable("customerJonny", jsonValue);
In my dto also have a field was named byteArrayId
The question is how can I deserialize the value of the byteArrayId
to a JsonNode object.
If someone have another solution tell me please.
Maybe some interface of camunda provided such method to deserialize the value of the BYTEARRAY_ID
to any formated json value or a java object.
Thanks you all.