当前位置: 首页 > news >正文

Flowable获取下一个节点审批人和审批组

@Overridepublic void getNextStepList(String taskId, String processInstanceId) throws IllegalAccessException {// taskService、repositoryService 等容器对象获取省略...// 存储当前节点的下一环节的所有用户节点ArrayList<UserTask> userTaskList = new ArrayList<>();Task task = taskService.createTaskQuery().taskId(taskId).singleResult();//获取流程定义idString definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult().getProcessDefinitionId();//获取bpmn对象BpmnModel bpmnModel = repositoryService.getBpmnModel(definitionId);//遍历返回下一个环节所有用户节点getNextUserTaskList(userTaskList, bpmnModel, task.getTaskDefinitionKey());//输出for (UserTask userTask : userTaskList) {System.out.println("下一个节点id:" + userTask.getId() + " 下一个节点名称:" + userTask.getName()+" 下一个节点审批人:" + userTask.getAssignee()+" 下一个节点候选组:" + (userTask.getCandidateGroups()!=null?userTask.getCandidateGroups().get(0):""));}}private void getNextUserTaskList(ArrayList<UserTask> userTaskList, BpmnModel bpmnModel, String currentId) {//通过节点定义id获取当前节点FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(currentId);//当前节点所有输出顺序流List<SequenceFlow> outgoingFlows = flowNode.getOutgoingFlows();FlowElement targetFlowElement = null;for (SequenceFlow outgoingFlow : outgoingFlows) {// 忽略非正常流转的节点,"${pass}"为自定义的流转表达式if (outgoingFlow.getConditionExpression() != null && !"${pass}".equals(outgoingFlow.getConditionExpression())) {continue;}targetFlowElement = outgoingFlow.getTargetFlowElement();//用户节点if (targetFlowElement instanceof UserTask) {userTaskList.add((UserTask) targetFlowElement);} else if (targetFlowElement instanceof EndEvent) {// 结束节点}else {// 没有找到用户节点,且下一节点不是最后一个节点,继续查找getNextUserTaskList(userTaskList, bpmnModel, targetFlowElement.getId());}}}

http://www.mrgr.cn/news/19287.html

相关文章:

  • 利用Spring Boot实现微服务的API限流策略
  • 用于基于骨架的动作识别的空间时间图卷积网络 ST-GCN (代码+数据集+模型)
  • window.localStorage 与 window.sessionStorage的区别
  • PTA单词首字母大写
  • opencv学习时常用linux命令
  • [Java]SpringBoot业务代码增强
  • AI-Talk开发板之helloword
  • Python OpenCV 深入理解(二)
  • Arduino简介
  • 【C++题解】1002 - 编程求解1+2+3+...+n
  • 通过任务建立职业自信
  • 万界星空科技云MES系统:提升生产效率与质量
  • C++ | Leetcode C++题解之第393题UFT-8编码验证
  • Python | Leetcode Python题解之第393题UTF-8编码验证
  • 如何选择SSD
  • IBM企业流程框架方法论-附PPT下载
  • 查看端口被占用情况
  • 读软件开发安全之道:概念、设计与实施17读后总结与感想兼导读
  • 山东省行政执法证照片要求及图像处理方法
  • 基于web设备管理系统设计与实现