I want to set a local variable via REST-API in the event-subprocess.
Following problem occurs:
The variable “localVariable” will be set in global process scope
With this said, the variable “localVariable” gets overriden every time a new event-subprocess occurs…
My question:
Is there any way to set local variables in an event-subprocess via the REST-API at message start?
Currently I found a workaround to set local variables in event subprocess by adding an execution listener to the message start event.
Nevertheless I think that is not a very clean workaround, because every variable from the REST-API call gets saved in global scope and than the execution listener creates a new local variable for it…
It seems to assume that a Message Correlation will save Process Instance Local Variables rather than Execution Local Variables. In the case the event sub process, it is the same Process Instance ID for the test user tasks, but their execution is different.
@pitu72 so the docs at the very least should be updated, because it’s non-intuitive but the docs also say “execution”. And a event sub process has the ability to hold local vars as shown above the photo.
@thorben I have updated the issue further with a explanation of the implications of the current impl and how the docs read vs the impl vs how anyone familiar with the system would understand whats going on.
At the very least, there should be some docs updates to occur in Rest API, Java API, and the Event Sub Process Docs