camunda-community-hub / process-execution-automator

Create scenario to automate any execution on process. Goal is: unit test, load test, CD/CI integration
1 stars 0 forks source link

How to update process variables during run time in Camunda 8? #27

Closed SonamGadkari closed 1 year ago

SonamGadkari commented 1 year ago

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

pierre-yves-monnet commented 1 year ago

hello, Is that related to this project? You should open a question on the forum for this question.

Check if the function is available in Operate: if not, then the function is not available. Best