How to update process variables during run time in Camunda 8? I am able to get process variables from the example src/main/java/org/camunda/automator/bpmnengine/camunda8/BpmnEngineCamunda8.java.
I am looking for Camunda 8 equivalent for below. For example in Camunda 7 below is the way to update a variable for all running process instance.
Hi Team,
How to update process variables during run time in Camunda 8? I am able to get process variables from the example src/main/java/org/camunda/automator/bpmnengine/camunda8/BpmnEngineCamunda8.java.
I am looking for Camunda 8 equivalent for below. For example in Camunda 7 below is the way to update a variable for all running process instance.
List processInstances =
runtimeService.createProcessInstanceQuery()
.processDefinitionKey(processKey)
.active()
.list();
processInstances.forEach(processInstance -> {
List executions = runtimeService.createExecutionQuery()
.processInstanceId(processInstance.getId())
.list();
executions.forEach(execution -> {
runtimeService.setVariable(execution.getId(), variableName, variableValue);
});
});
Do you have any example on process variables changes in the camunda community?
Thanks, Sonam Gadekari