主要应用于实际开发中,考虑到会有人员调动的情况
public void changeManager(String original,String now,String variableName){
//当前任务授予人替换
List<Task> list = taskService.createTaskQuery().taskAssignee(original).list();
list.stream().forEach((item)->{
taskService.setAssignee(item.getId(),now);
});
//还未到达的进程,进行全局的替换
List<ProcessInstance> list1 = runtimeService.createProcessInstanceQuery().list();
list1.stream().forEach((item)->{
if(runtimeService.getVariable(item.getId(),variableName).equals(original)){
runtimeService.setVariable(item.getId(),variableName,now);
}
});
}
标签:订阅,String,list,UserTask,item,getId,Camunda,now,variableName
From: https://blog.csdn.net/qq_70835082/article/details/140461397