I have Spring Boot application having embedded BPM Engine and below dependencies in my POM:
Parent POM describes BOMs as below in dependency management:
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-bom</artifactId>
<version>7.15.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-bom</artifactId>
<version>1.10.1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
and child pom defines dependencies below:
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
</dependency>
<dependency>
<groupId>org.camunda.bpm.springboot</groupId>
<artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
</dependency>
<dependency>
<groupId>org.camunda.bpm</groupId>
<artifactId>camunda-engine-plugin-spin</artifactId>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-core</artifactId>
</dependency>
<dependency>
<groupId>org.camunda.spin</groupId>
<artifactId>camunda-spin-dataformat-json-jackson</artifactId>
</dependency>
I kick-off a process with below code:
VariableMap variables = Variables.createVariables()
.putValueTyped("input",
Variables.objectValue(myDto).create())
.putValueTyped("inputArray",
Variables.objectValue(myDto.getArray()).create()));
ProcessInstance instance = runtimeService.startProcessInstanceByKey(
"processName", "processBusinessKey", variables);
In my delegate, I get the variables like below (inputArray is a List of concrete type ArrayList):
ObjectValue myArrayObj = execution.getVariableTyped("inputArray");
@SuppressWarnings("unchecked")
List<MyDto> myArray = (List<MyDto>) orderArrayObj.getValue();
Everything works fine unless I change the value of this variable from TaskList application. My scenario is to show user some values from these variables and in case of certain conditions, allow them to change these values and complete the tasks. Below is the exception I get when this object is changed (change any smallest of the property from TaskList by claiming the task, loading the variables and then without changing the type or anything else, add some text in any existing property of this variable):
Caused by: spinjar.com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.util.ArrayList<MyDto>` from String value (token `JsonToken.VALUE_STRING`)
at [Source: UNKNOWN; line: -1, column: -1]
at spinjar.com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1601) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1375) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1322) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:384) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.deser.std.CollectionDeserializer._deserializeFromString(CollectionDeserializer.java:318) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:250) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:28) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4569) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at spinjar.com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2867) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
at org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatMapper.mapInternalToJava(JacksonJsonDataFormatMapper.java:98) ~[camunda-spin-dataformat-all-1.10.1.jar:1.10.1]
... 110 common frames omitted
Any help would be much appreciated.
Thanks