I am using flowable with springboot and I would like to know how to retrieve variables inserted at the beginning of a process. Below is my attempt. I however have no idea of how to get the execution id.
@Autowired
private RuntimeService runtimeService;
@Transactional
public void startProcess(ClientData clientData) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("clientData", gson.toJson(clientData));
//Insert variables at the start of the process
runtimeService.startProcessInstanceByKey("idscan-process",variables);
}
void getVariables(){
Object x = runtimeService.getVariable(execution.getId(), "clientData");
sendData(x);
}
Your approach is correct. The execution id is the process instance id that you started