How to pass a custom json in subprocess in Camunda modeler

I am trying to pass a JSON to customJson target variable in a subprocess, the JSON would be something like {id: 1, name: ‘indil’}, how does that work ?

Another one would be to see how to build the JSON dynamically from the execution variables.

Was this post helpful? Save and retrieve JSON variable

That should at least cover the passing the variable as a JSON object.

Best Regards,

I am assuming this is what you meant, when I tried this, I just see null when I am trying to access the variable inside the subprocess

Took a screenshot just before it was about to start the subprocess and the input Variable customJson is null

I believe that you have to map that variable out so that the following task will have access to it.

Best Regards,

How do I map out the variable in the Modeler UI in that properties panel ? That was the question I had ?

Should it be done in a prior process and be passed into this subprocess ?

I got lazy and just put this in the XML:

<bpmn:callActivity id="sub-process-id" name="Sub Process Name" calledElement="subProcess">
        <camunda:in businessKey="#{execution.processBusinessKey}" />
        <camunda:in variables="all" />
        <camunda:out variables="all" />

Which worked in passing all variables.