Serialization not working

I am trying to populate a select with options from a variable following the tutorial:

https://docs.camunda.org/manual/latest/reference/embedded-forms/controls/select/

Unfortunately it does not work and I get an error:

Cannot instantiate process definition approve-car-rent-process:1:c9d1731b-2c2c-11e8-a8f2-e4a471e82f74: Cannot find serializer for value ‘ObjectValue [value={001=Nissan, 002=VW Golf, 003=BMW Series 3}, isDeserialized=true, serializationDataFormat=application/json, objectTypeName=null, serializedValue=null]’.

My code:

public class AvailableCars implements ExecutionListener {

@Override
public void notify(DelegateExecution execution) throws Exception {
    Map<String, String> cars = new HashMap<>();
    cars.put("001", "Nissan");
    cars.put("002", "VW Golf");
    cars.put("003", "BMW Series 3");

    execution.setVariable("cars", objectValue(cars) .serializationDataFormat(Variables.SerializationDataFormats.JSON).create());
}

}

My template:

<div class="form-group">
    <label for="car">Car</label>
    <select cam-variable-name="car"
            cam-variable-type="String"
            cam-choices="cars">
    </select>
</div>

Please advise.

Best Regards
Alexander KIRILOV

1 Like

Hi Alexander,

Make sure Spin integration is properly configured as described here: https://docs.camunda.org/manual/7.8/user-guide/data-formats/configuring-spin-integration/

Cheers,
Thorben

Thank you Thorben, you have pointed me in the right direction. It turned out I was missing the following dependency in the pom:

    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-plugin-spin</artifactId>
        <version>7.8.0</version>
    </dependency>

And since I am using spring boot, the rest was autoconfigured by the starter:

Thank you and have a great day!