And then I want to iterate over the contacts in a multi instance sub proces. I define contacts as collection and define “contact” as element variable. I hoped that Camunda would use the same SerializationDataFormat. However, when i inspect the variable in the cockpit, “contact” is not persisted as JSON.
How can I instruct Camunda to serialize as JSON when using multi instance element variable?
Is the subprocess contained in the same application as the calling process? What is the serialisation format set to? I assume it’s not JSON, otherwise you wouldn’t need to set it explicitly for the variable.
As to the serialisation “inheritance”: I would not expect it. IMO the element variable should be serialised according to the format set for the engine.
The <property name="javaSerializationFormatEnabled">true</property> setting is used to enable Java serialization as a supported format for process variables in Camunda BPM. This allows Java objects to be stored and retrieved from the process engine’s database during process execution.
When to Use:
Custom Java Objects as Process Variables:
If you need to store complex Java objects (e.g., custom classes) as process variables.
Serialization for Inter-Process Communication:
When serialized Java objects are required for communication between different processes or systems.