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