Hi everyone! I have a question regarding working with getRuntimeService. I have a process with parameters (“parameters-process”) that contains a list of necessary variables for use by other processes. This process is always running (with a user task set in it). When another process starts, it executes a script:
var rs = execution.getProcessEngineServices().getRuntimeService();
var pi = rs.createProcessInstanceQuery().processDefinitionKey(“parameters-process”).list();
for (key in pi[0].variables) {
execution.setVariable(key, pi[0].variables.getValueTyped(key));
}
and reads all the necessary variables. This always worked well, but recently, this script stopped working. I can’t read the variables (they’re simply not visible). The only thing that changed was the Camunda version, which is now 7.20 (there might have been other changes, but I’m unaware of them). Does anyone know what could have happened? Are there any other ways to read these variables from the parameters process?"
Hi @A_M, if you can provide some more detail it will help. For example, what was the prior version of Camunda you were using before upgrading to 7.20? Also, is it possible to provide a simple cut down version of the two processes that are interacting that demonstrates the behaviour you are seeing?
With this information it will be easier for others to quickly reproduce the issue you are facing
It may also be worth looking at the release notes or the issue log in Github (Issues · camunda/camunda-bpm-platform · GitHub) for fixed issues between your prior version of Camunda and 7.20 to see if anything looks related to your issue.
Hi @A_M, using Camunda 7.21. I just did a short experiment and was able to prove the basic principle of what you are trying to achieve is working. What I did:
create a source process that defines process variables “a” and “b” and waits
create a consumer process that looks up the other using the runtime service and reads its process variables and sets them in it’s own scope