Im trying to fetch all variables of given process instance outside worker method.
Requirement is:
External system calls our rest endpoint(non-zeebe) and our system trigger the message event(publish message) using zeebe client and during this call, I want to pass updated existing process variables.
Say I want to update status of employee verification object/json to “success”.
Hence trying to access it using process instance id. I tried to find method using zeebeClient object but no luck till now.
Hey @camundabpmlearner!
My recommendation is to only change variables from within the process. If you start doing this from the outside you can cause some serious damage to running processes.
When doing changes of process variables from within the process I can recommend using event based subprocesses which are being triggered via messages. You could also pass variables along.
Hi @Hafflgav
My problem is, how can we access variable which comes in later stage?
Here in subscription correlation I mapped variable which will have value in later stage but as soon as I start process, I get error saying expected value but found NULL, this is pointing to variable processInstanceId which I create in first worker.
Hey @camundabpmlearner,
I would need some more of your code / process to help you out here.
But to get this right:
You do not want to initialise values using the non-interrupting event-based process, right? It is just about overriding already existing values. (This differentiation would be quite important to make this work)
@camundabpmlearner, that’s correct!
But the variables you want to update already exist in the “main process”.
The processInstanceId is created during the start of the process. In case the process does not exist yet you cannot update any variables.
You would also need to start the process with an object that contains the values you want to override.