I am new at Camunda and just started learning. I am trying to populate a drop down list at the startEvent. I have the drop down in the embedded form like this.
<select cam-variable-name="PRODUCT_TYPE"
cam-variable-type="String"
cam-choices="AVAILABLE_PRODUCT_TYPES">
</select>
I do not know where to implement the java delegate with a code that should look similar to this.
Map<String, String> productTypes = new HashMap<String, String>();
productTypes.put("001", "Notebook");
productTypes.put("002", "Server");
productTypes.put("003", "Workstation");
execution.setVariable("AVAILABLE_PRODUCT_TYPES",
objectValue(customerData)
.serializationDataFormat(SerializationDataFormats.JSON)
.create());
Listeners do not work for startEvent. I have tried camunda:formHandlerClass extension. That did get invoked but it resulted in a blank form being printed since createStartFormData was returning null.
ExecutionListener with event=“start” gets invoked when the startEven is executed … i.e. when i press start process. How do i populate variables before this.
Please point me in the right direction.