Hi @pitu72,
the behavior you are encountering is expected with regards to event subprocesses.
The documentation states for processVariablesLocal
that
A map of local variables that is injected into the triggered execution or process instance after the message has been delivered
With regard to your process definition, the message start event of the event subprocess leads to the creation of a message subscription for the execution of the enclosing process instance rather than the process definition (as it would be the case for a process-level message start event). Thus, the process instance is the waiting execution that is triggered by the message and therefore also receives the local variables. The execution of the subprocess start event and therefore the creation of the subprocess scope is triggered afterwards.
You could for example now map the process variables - that are created from the message payload - to the event subprocess with an input/output variable mapping.
If you furthermore pass the message payload to process variables transiently, they will not be persisted in the process instance scope and will only be persisted in the event subprocess scope.
Hope that helps.
Cheers,
Tobias