Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 使用springboot从可流动运行时服务检索变量_Spring Boot_Flowable - Fatal编程技术网

Spring boot 使用springboot从可流动运行时服务检索变量

Spring boot 使用springboot从可流动运行时服务检索变量,spring-boot,flowable,Spring Boot,Flowable,我将flowable与springboot一起使用,我想知道如何检索在流程开始时插入的变量。下面是我的尝试。但是,我不知道如何获取执行id @Autowired private RuntimeService runtimeService; @Transactional public void startProcess(ClientData clientData) { Map<String, Object> variables = new HashMap<String,

我将flowable与springboot一起使用,我想知道如何检索在流程开始时插入的变量。下面是我的尝试。但是,我不知道如何获取执行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);
}
@Autowired
私有RuntimeService RuntimeService;
@交易的
public void startProcess(ClientData ClientData){
Map variables=newhashmap();
variables.put(“clientData”,gson.toJson(clientData));
//在流程开始时插入变量
startProcessInstanceByKey(“idscan进程”,变量);
}
void getVariables(){
对象x=runtimeService.getVariable(execution.getId(),“clientData”);
sendData(x);
}

您的方法是正确的。执行id是您启动的流程实例id

您的方法是正确的。执行id是您启动的流程实例id