Get execution given a ProcessInstanceId


I want in main process A to get the execution of another process B, so I can update a variable in B.
The only thing I have in A, is the processInstanceId of B.
How to do it with a javascript?


Hi @kontrag,

the process instance id of B is all what you need. You can use a script task to set the variable with the following script:

execution.getProcessEngineServices().getRuntimeService().setVariable(processInstanceIdOfB, "foo", 42)

Does this help you?

Best regards,