Retrieve variables from flowable runtime service using springboot

984 views Asked by At

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);
}
1

There are 1 answers

0
Filip On BEST ANSWER

Your approach is correct. The execution id is the process instance id that you started