Conversion of ExecutionListeners from Camunda7 to Camunda8

Hii community,
In my Organization we are working to migrate our workflows from camunda-7 to camunda-8.
While converting the bpmn diagram , i found that we dont have execution listners in camunda8.(till 8.5 version).
Here is the xml of demoProcess of camunda 7.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1nklano" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.0">
  <bpmn:process id="Process_0wvktfh" isExecutable="true">
    <bpmn:subProcess id="Activity_1t43g61" name="EventSubprocessTwo" triggeredByEvent="true">
      <bpmn:documentation>93</bpmn:documentation>
      <bpmn:startEvent id="Event_1n0irso" name="Operation Completed" camunda:asyncBefore="true" camunda:asyncAfter="true" isInterrupting="false">
        <bpmn:documentation>94</bpmn:documentation>
        <bpmn:extensionElements>
          <camunda:executionListener expression="${execution.setVariableLocal(&#34;activatePackage&#34;,activatePackage)}" event="end" />
          <camunda:executionListener expression="${execution.setVariableLocal(&#34;operationId&#34;,operationId)}" event="end" />
          <camunda:executionListener delegateExpression="#{variablesMappingDelegate}" event="end" />
          <camunda:executionListener expression="${execution.setVariableLocal(&#34;operationCompletedDelayTime&#34;,operationCompletedDelayTime)}" event="end" />
        </bpmn:extensionElements>
        <bpmn:outgoing>Flow_0d770rg</bpmn:outgoing>
        <bpmn:messageEventDefinition id="MessageEventDefinition_0djg7ko" messageRef="Message_1g34u23" />
      </bpmn:startEvent>
      <bpmn:intermediateCatchEvent id="Event_0uo9nvx" name="DelayTimer" camunda:asyncBefore="true" camunda:asyncAfter="true">
        <bpmn:documentation>95</bpmn:documentation>
        <bpmn:incoming>Flow_0d770rg</bpmn:incoming>
        <bpmn:outgoing>Flow_1s3a3oh</bpmn:outgoing>
        <bpmn:timerEventDefinition id="TimerEventDefinition_188hx1e">
          <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">${operationCompletedDelayTime}</bpmn:timeDuration>
        </bpmn:timerEventDefinition>
      </bpmn:intermediateCatchEvent>
      <bpmn:endEvent id="Event_1dlndb9" name="End">
        <bpmn:documentation>96</bpmn:documentation>
        <bpmn:incoming>Flow_1s3a3oh</bpmn:incoming>
        <bpmn:messageEventDefinition id="MessageEventDefinition_1jau3xe" messageRef="Message_0993gq9" camunda:expression="${execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation(&#34;EVENT_ACTIVATE_PACKAGE&#34;).processInstanceBusinessKey(execution.getBusinessKey()).setVariable(&#34;activatePackage&#34;,activatePackage).setVariable(&#34;operationId&#34;,operationId).correlateWithResult()}" />
      </bpmn:endEvent>
      <bpmn:sequenceFlow id="Flow_1s3a3oh" sourceRef="Event_0uo9nvx" targetRef="Event_1dlndb9" />
      <bpmn:sequenceFlow id="Flow_0d770rg" sourceRef="Event_1n0irso" targetRef="Event_0uo9nvx" />
    </bpmn:subProcess>
    <bpmn:subProcess id="Activity_0l8lwqs" name="EventSubprocessOne" triggeredByEvent="true">
      <bpmn:endEvent id="Event_0dlri8i" name="end">
        <bpmn:documentation>116</bpmn:documentation>
        <bpmn:incoming>Flow_05vepq5</bpmn:incoming>
      </bpmn:endEvent>
      <bpmn:startEvent id="Event_0kkg5w0" name="Operation Changed" camunda:asyncBefore="true" isInterrupting="false">
        <bpmn:documentation>112</bpmn:documentation>
        <bpmn:extensionElements>
          <camunda:executionListener delegateExpression="#{variablesMappingDelegate}" event="end" />
          <camunda:executionListener event="start">
            <camunda:script scriptFormat="JavaScript">var packageStateChanged = JSON.parse(execution.getVariable("packageStateChanged"));
var operationCode = packageStateChanged.packageStateChange.operationCode;
execution.setVariableLocal("operationCode", operationCode);
var packageState = packageStateChanged.packageStateChange.state;
execution.setVariableLocal("packageState", packageState);
execution.setVariableLocal("packageStateChanged", execution.getVariable("packageStateChanged"));</camunda:script>
          </camunda:executionListener>
        </bpmn:extensionElements>
        <bpmn:outgoing>Flow_0jyje16</bpmn:outgoing>
        <bpmn:messageEventDefinition id="MessageEventDefinition_0m6mnlo" messageRef="Message_166cqz7" />
      </bpmn:startEvent>
      <bpmn:businessRuleTask id="Activity_1i2jr0g" name="Some_DMN" camunda:asyncBefore="true" camunda:resultVariable="packageStateDMNResult" camunda:decisionRef="PACKAGE_STATE" camunda:mapDecisionResult="singleEntry">
        <bpmn:documentation>113</bpmn:documentation>
        <bpmn:extensionElements>
          <camunda:failedJobRetryTimeCycle>R10/PT1M</camunda:failedJobRetryTimeCycle>
          <camunda:field name="">
            <camunda:expression></camunda:expression>
          </camunda:field>
        </bpmn:extensionElements>
        <bpmn:incoming>Flow_0jyje16</bpmn:incoming>
        <bpmn:outgoing>Flow_118skmx</bpmn:outgoing>
      </bpmn:businessRuleTask>
      <bpmn:sequenceFlow id="Flow_118skmx" sourceRef="Activity_1i2jr0g" targetRef="Activity_06ejn1z" />
      <bpmn:sequenceFlow id="Flow_0jyje16" sourceRef="Event_0kkg5w0" targetRef="Activity_1i2jr0g" />
      <bpmn:serviceTask id="Activity_06ejn1z" name="someServiceTak" camunda:delegateExpression="#{someServiceTaskDelegate}">
        <bpmn:incoming>Flow_118skmx</bpmn:incoming>
        <bpmn:outgoing>Flow_05vepq5</bpmn:outgoing>
      </bpmn:serviceTask>
      <bpmn:sequenceFlow id="Flow_05vepq5" sourceRef="Activity_06ejn1z" targetRef="Event_0dlri8i" />
    </bpmn:subProcess>
  </bpmn:process>
  <bpmn:message id="Message_1h63n2t" name="EVENT_SHIPMENT_CONFIRMED" />
  <bpmn:message id="Message_1ecozo7" name="EVENT_INITIALIZE_PACKAGE" />
  <bpmn:message id="Message_1j1ikxt" name="EVENT_ACTIVATE_PACKAGE" />
  <bpmn:message id="Message_1g34u23" name="EVENT_OPERATION_COMPLETED" />
  <bpmn:message id="Message_0993gq9" name="EVENT_ACTIVATE_PACKAGE" />
  <bpmn:message id="Message_166cqz7" name="EVENT_PACKAGE_STATE_CHANGED" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_0wvktfh">
      <bpmndi:BPMNShape id="Activity_1t43g61_di" bpmnElement="Activity_1t43g61" isExpanded="true">
        <dc:Bounds x="190" y="80" width="350" height="200" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_1s3a3oh_di" bpmnElement="Flow_1s3a3oh">
        <di:waypoint x="383" y="180" />
        <di:waypoint x="482" y="180" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0d770rg_di" bpmnElement="Flow_0d770rg">
        <di:waypoint x="266" y="180" />
        <di:waypoint x="347" y="180" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_1n0irso_di" bpmnElement="Event_1n0irso">
        <dc:Bounds x="230" y="162" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="223" y="205" width="54" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0uo9nvx_di" bpmnElement="Event_0uo9nvx">
        <dc:Bounds x="347" y="162" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="339" y="205" width="56" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1dlndb9_di" bpmnElement="Event_1dlndb9">
        <dc:Bounds x="482" y="162" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="490" y="205" width="20" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0l8lwqs_di" bpmnElement="Activity_0l8lwqs" isExpanded="true">
        <dc:Bounds x="150" y="360" width="500" height="210" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_118skmx_di" bpmnElement="Flow_118skmx">
        <di:waypoint x="360" y="460" />
        <di:waypoint x="420" y="460" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0jyje16_di" bpmnElement="Flow_0jyje16">
        <di:waypoint x="206" y="460" />
        <di:waypoint x="260" y="460" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_05vepq5_di" bpmnElement="Flow_05vepq5">
        <di:waypoint x="520" y="460" />
        <di:waypoint x="572" y="460" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_0kkg5w0_di" bpmnElement="Event_0kkg5w0">
        <dc:Bounds x="170" y="442" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="164" y="485" width="49" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1i2jr0g_di" bpmnElement="Activity_1i2jr0g">
        <dc:Bounds x="260" y="420" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1cr83l4_di" bpmnElement="Activity_06ejn1z">
        <dc:Bounds x="420" y="420" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0dlri8i_di" bpmnElement="Event_0dlri8i">
        <dc:Bounds x="572" y="442" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="581" y="485" width="19" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

In 7 , While starting the subprocessEvents we are using executionListeners in which we are using Expression , DelegateExpression and Script too.(it can be any combination of these three).
But in 8 we dont have executionListeners , how we can convert these three components in out camunda-8 diagram.
Above is the reference BPMN which we want to convert in 8.
Thanks

Hi @Ansh_Kumar

Execution Listeners are going to be available in the next release (8.6.0) which is due in October. They’re available now in fact in the 8.6.-alpha4 that was released a few weeks ago.
That said they’re are some differences in how executions listeners in C8 run - so can you explain a little bit about what exactly the listeners you’ve created do and what you’re using them for?

Hi @Niall ,
We don’t want to move directly to 8.6 version which is going to release ,or the alpha version which you have mentioned that has been released weeks ago , first we want to move with 8.4 or 8.5.(for stability reasons.)
In 7 we have created listeners

  1. To set the variables at event subprocessLevel
    example : ${execution.setVariableLocal("packageStateChanged",packageStateChanged)}
  2. To call some JavaDelegates
    example: #{statusTraceDelegate}
    3)To run Script like
    example:
var packageStateChanged = JSON.parse(execution.getVariable("packageStateChanged"));
var operationCode = packageStateChanged.packageStateChange.operationCode;
execution.setVariableLocal("operationCode", operationCode);
var packageState = packageStateChanged.packageStateChange.state;
execution.setVariableLocal("packageState", packageState);
execution.setVariableLocal("packageStateChanged", execution.getVariable("packageStateChanged"));

For your first example. You wouldn’t need a listener you can just use the Inputs feature
image

The second one is more complicated because Camunda 8 does not directly call Java Classes. Any classes you want to call need to be Job Workers and need to be run externally from the engine. This is true of all service tasks and will be true of execution listeners as well.

Running a script especially one that is manipulating process variables, is likely to be much easier in Camunda 8. Especially because JSON is the native data structure so there’s no need to mess around with parsers, you can just use the Input features as mentioned before. BUT there the expression language you need to use is FEEL you can’t use other scripting languages.

There are a bunch of tools to help you convert existing diagrams including expressions to C8 so that’s a good place to start to get an idea of how hard a migration might be. Try it out for yourself with your own models

1 Like

Hi @Niall ,
As you mentioned above i am setting Variable at subprocessLevel locally , but i have found that i am able to access it another subprocess to ? , why it is happening , it should be only at that specific subprocess level.
Here’s the screenshot.
Here i am creating two variables , but i am able to access in other subprocess

Here you can see it has become processVariable , and i haven’t done anything for variable propogation

Can you show how and where you’re setting the variables.


@Niall
You can see here , i am setting local variables at subprocess : Update FO Items to Shipment Confirmed

But i am able to access it other subprocesses and in main process to . like i am access to both these variables in Update FO Items to Ready To Ship

I tried this out and wasn’t able to replicate the issue you’re having. In the process i created I also have two event sub-processes each created a local variable

In both cases the local variables stay local to the sub process they where created and are not accessible globally or by other sub processes.

CreatinglocalVariables

@Niall ,
I am using zeebeClient to publishMessage and start a event Subprocess

What it is doing this is creating variable at root level .
here are the screenshots.

If i can conclude what i want to achieve , i want to use zeebeClient to publish a message to start a processInstance(event subprocess) and while publishing message set variables at local level of subprocess.

But what is happening , variables are creating at root level.

Here is the xml , if you will run it you will replicate the situation that i am getting

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_173cp8m" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.26.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.5.0">
  <bpmn:process id="Process_1hi8hnm" name="DemoProcess" isExecutable="true">
    <bpmn:subProcess id="EventSubProcessShipmentConfirmed" name="Update FO Items to Shipment Confirmed" triggeredByEvent="true">
      <bpmn:extensionElements>
        <zeebe:ioMapping>
          <zeebe:input source="=shipmentConfirmed" target="shipmentConfirmed" />
          <zeebe:input source="=logisticOrderId" target="logisticOrderId" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:startEvent id="ShipmentConfirmed" name="Shipment Confirmed" isInterrupting="false">
        <bpmn:outgoing>Flow_019vkla</bpmn:outgoing>
        <bpmn:messageEventDefinition id="MessageEventDefinition_0e748q8" messageRef="Message_19p0clt" />
      </bpmn:startEvent>
      <bpmn:serviceTask id="UpdateFOShipmentConfirmed" name="Update FO">
        <bpmn:extensionElements>
          <zeebe:taskDefinition type="camunda-7-adapter" retries="10" />
          <zeebe:taskHeaders>
            <zeebe:header key="delegateExpression" value="#{updateFulfilmentOrderShipmentConfirmedDelegate}" />
          </zeebe:taskHeaders>
        </bpmn:extensionElements>
        <bpmn:incoming>Flow_019vkla</bpmn:incoming>
        <bpmn:outgoing>Flow_15p76al</bpmn:outgoing>
      </bpmn:serviceTask>
      <bpmn:endEvent id="Event_1e5mv7o" name="End">
        <bpmn:incoming>Flow_15p76al</bpmn:incoming>
      </bpmn:endEvent>
      <bpmn:sequenceFlow id="Flow_019vkla" sourceRef="ShipmentConfirmed" targetRef="UpdateFOShipmentConfirmed" />
      <bpmn:sequenceFlow id="Flow_15p76al" sourceRef="UpdateFOShipmentConfirmed" targetRef="Event_1e5mv7o" />
    </bpmn:subProcess>
    <bpmn:subProcess id="EventSubProcessReadyToCollect" name="Update FO Items to Ready To Collect" triggeredByEvent="true">
      <bpmn:startEvent id="Event_01jr79q" name="Ready To Collect" isInterrupting="false">
        <bpmn:outgoing>Flow_18donhj</bpmn:outgoing>
        <bpmn:messageEventDefinition id="MessageEventDefinition_0usid15" messageRef="Message_1ra7225" />
      </bpmn:startEvent>
      <bpmn:serviceTask id="UpdateFoReadyToCollect" name="Update FO">
        <bpmn:extensionElements>
          <zeebe:taskDefinition type="camunda-7-adapter" retries="10" />
          <zeebe:taskHeaders>
            <zeebe:header key="delegateExpression" value="#{updateFulfilmentOrderStateDelegate}" />
          </zeebe:taskHeaders>
        </bpmn:extensionElements>
        <bpmn:incoming>Flow_18donhj</bpmn:incoming>
        <bpmn:outgoing>Flow_0ihuy85</bpmn:outgoing>
      </bpmn:serviceTask>
      <bpmn:endEvent id="Event_0cugb3j" name="EventReadyToCollectEnd">
        <bpmn:incoming>Flow_0ihuy85</bpmn:incoming>
      </bpmn:endEvent>
      <bpmn:sequenceFlow id="Flow_18donhj" sourceRef="Event_01jr79q" targetRef="UpdateFoReadyToCollect" />
      <bpmn:sequenceFlow id="Flow_0ihuy85" sourceRef="UpdateFoReadyToCollect" targetRef="Event_0cugb3j" />
    </bpmn:subProcess>
    <bpmn:startEvent id="Event_19m9b6g" name="StartEvent">
      <bpmn:outgoing>Flow_0155wo8</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_0155wo8" sourceRef="Event_19m9b6g" targetRef="Activity_1okjr6g" />
    <bpmn:serviceTask id="Activity_1okjr6g" name="GetData">
      <bpmn:extensionElements>
        <zeebe:taskHeaders>
          <zeebe:header key="delegateExpression" value="#{getData}" />
        </zeebe:taskHeaders>
        <zeebe:taskDefinition type="camunda-7-adapter" retries="10" />
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0155wo8</bpmn:incoming>
      <bpmn:outgoing>Flow_0m5pqza</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:sequenceFlow id="Flow_0m5pqza" sourceRef="Activity_1okjr6g" targetRef="Event_1tz9hc1" />
    <bpmn:intermediateCatchEvent id="Event_1tz9hc1">
      <bpmn:incoming>Flow_0m5pqza</bpmn:incoming>
      <bpmn:outgoing>Flow_1lxipox</bpmn:outgoing>
      <bpmn:messageEventDefinition id="MessageEventDefinition_1bywc1x" messageRef="Message_3vjka7n" />
    </bpmn:intermediateCatchEvent>
    <bpmn:endEvent id="Event_1q5v6uc" name="End Event">
      <bpmn:incoming>Flow_1lxipox</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_1lxipox" sourceRef="Event_1tz9hc1" targetRef="Event_1q5v6uc" />
  </bpmn:process>
  <bpmn:message id="Message_19p0clt" name="EVENT_SHIPMENT_CONFIRMED">
    <bpmn:extensionElements>
      <zeebe:subscription correlationKey="=businessKey" />
    </bpmn:extensionElements>
  </bpmn:message>
  <bpmn:message id="Message_1ra7225" name="EVENT_READY_TO_COLLECT">
    <bpmn:extensionElements>
      <zeebe:subscription correlationKey="=businessKey" />
    </bpmn:extensionElements>
  </bpmn:message>
  <bpmn:message id="Message_3vjka7n" name="ProcessDone">
    <bpmn:extensionElements>
      <zeebe:subscription correlationKey="=businessKey" />
    </bpmn:extensionElements>
  </bpmn:message>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1hi8hnm">
      <bpmndi:BPMNShape id="Event_19m9b6g_di" bpmnElement="Event_19m9b6g">
        <dc:Bounds x="162" y="102" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="154" y="145" width="52" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0491nej_di" bpmnElement="Activity_1okjr6g">
        <dc:Bounds x="250" y="80" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0pxl8xh_di" bpmnElement="Event_1tz9hc1">
        <dc:Bounds x="402" y="102" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1q5v6uc_di" bpmnElement="Event_1q5v6uc">
        <dc:Bounds x="492" y="102" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="485" y="145" width="51" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_06a5r3c_di" bpmnElement="EventSubProcessShipmentConfirmed" isExpanded="true">
        <dc:Bounds x="190" y="390" width="370" height="200" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1uipfll_di" bpmnElement="ShipmentConfirmed">
        <dc:Bounds x="212" y="472" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="205" y="515" width="51" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0lt9x6x_di" bpmnElement="UpdateFOShipmentConfirmed">
        <dc:Bounds x="320" y="450" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1e5mv7o_di" bpmnElement="Event_1e5mv7o">
        <dc:Bounds x="482" y="472" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="490" y="515" width="20" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_019vkla_di" bpmnElement="Flow_019vkla">
        <di:waypoint x="248" y="490" />
        <di:waypoint x="320" y="490" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_15p76al_di" bpmnElement="Flow_15p76al">
        <di:waypoint x="420" y="490" />
        <di:waypoint x="482" y="490" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Activity_0285mng_di" bpmnElement="EventSubProcessReadyToCollect" isExpanded="true">
        <dc:Bounds x="640" y="390" width="360" height="200" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1xwcq6q_di" bpmnElement="Event_01jr79q">
        <dc:Bounds x="672" y="472" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="650" y="515" width="83" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1bj8q43_di" bpmnElement="UpdateFoReadyToCollect">
        <dc:Bounds x="770" y="450" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0cugb3j_di" bpmnElement="Event_0cugb3j">
        <dc:Bounds x="922" y="472" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="885" y="515" width="89" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_18donhj_di" bpmnElement="Flow_18donhj">
        <di:waypoint x="708" y="490" />
        <di:waypoint x="770" y="490" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0ihuy85_di" bpmnElement="Flow_0ihuy85">
        <di:waypoint x="870" y="490" />
        <di:waypoint x="922" y="490" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0155wo8_di" bpmnElement="Flow_0155wo8">
        <di:waypoint x="198" y="120" />
        <di:waypoint x="250" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0m5pqza_di" bpmnElement="Flow_0m5pqza">
        <di:waypoint x="350" y="120" />
        <di:waypoint x="402" y="120" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1lxipox_di" bpmnElement="Flow_1lxipox">
        <di:waypoint x="438" y="120" />
        <di:waypoint x="492" y="120" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

for publishing message i am using springZeebeClient

 variables.put("shipmentConfirmed", "shipmentIsConfirmedNoWorries");
        variables.put("logisticOrderId", "two");
        zeebeClient.newPublishMessageCommand()
            .messageName("EVENT_SHIPMENT_CONFIRMED")
            .correlationKey("businessKey012").variables(variables).send();

Hii @Niall ,
Can you please suggest what am i missing in above . Why am i not able to set it only local level.

Hii @Philipp_Ossler ,
I have seen your thread regarding that , sorry to tag you here , but may be you can help.