Hi
I start a process with variables like this
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("logNumber", logNumber);
ProcessInstance processInstance = ProcessEngine.getExecutionService().startProcessInstanceByKey("myProcess", variables,businessKey);
after that, at some other point of my application i want to find if there is any execution that is running and has a specific value in some of the variables; ritght now i have this:
List<ProcessInstance> instances = ProcessEngineProxy.getExecutionService().createProcessInstanceQuery().processDefinitionId("myProcess").notSuspended().list();
if ((instances != null) && (!instances.isEmpty())) {
for (ProcessInstance processInstance : instances) {
processInstance.???????
}
}
but i am at a lost here; how do i retrieve the variables from each processInstance object ?? there seems to be no method to recover that map
please help, i am really new to this jbpm stuff
thanks
Hi Jose,
You can use ExecutionService.getVariable(executionId, varaibleName) to retrieve the variable value.