Hello,
is it possible to set a variable to a process by a given process instance ID with the Java API? Currently I can only set a variable by an execution ID (RuntimeService (camunda BPM Javadocs 7.3.7-ee). To achieve this I have to create an execution query with the given instance ID to receive any execution and set my variable to the process. Is this intended?
Example:
List<Execution> executions = runtimeService.createExecutionQuery().processInstanceId(instanceId).list();
Execution execution = executions.get(0); //check if null or empty
runtimeService.setVariable(execution.getId(), nameOfVariable, object);
It seems possible with the REST API: Put Single Process Variable | docs.camunda.org
Thanks.
Andreas