宁波网站排名优化报价网站建设与运营意义
2026/1/5 18:35:51 网站建设 项目流程
宁波网站排名优化报价,网站建设与运营意义,牛肉煲的做法,湖南茶叶品牌网站建设目录 1、环境 2、流程信息 3、需求 4、思路 5、【领导审批】节点配置 6、代码实现 1、环境 前端#xff1a;BPMN2.0.js 后端#xff1a;flowable:6.8.0 2、流程信息 流程图#xff08;7、流程文件在文章最后#xff09;#xff1a; 各节点信息#xff1a; 节点…目录1、环境2、流程信息3、需求4、思路5、【领导审批】节点配置6、代码实现1、环境前端BPMN2.0.js后端flowable:6.8.02、流程信息流程图7、流程文件在文章最后各节点信息节点名称节点id开始ks登记dj员工yg领导审批ldsp结束js3、需求【领导审批】节点需要多个审批人顺序审批或需要多个审批人都进行审批。【领导审批】节点的多个审批人需要动态设置。4、思路针对第一个需求使用的是【用户任务】的多实例。针对第二个需求在使用【用户任务】的多实例情况下使用【执行监听器】。5、【领导审批】节点配置【领导审批】节点xml配置bpmn2:userTask idldsp name领导审批 flowable:dataTypeUSERS flowable:assignee${assignee} flowable:candidateUsers分管领导001,部门领导001 flowable:text分管领导001,部门领导001 bpmn2:extensionElements flowable:executionListener classcom.cn.workflow.flowable.listener.FlowExecutionListener eventstart / /bpmn2:extensionElements bpmn2:incomingsq/bpmn2:incoming bpmn2:outgoingFlow_13elc6g/bpmn2:outgoing bpmn2:outgoingth/bpmn2:outgoing bpmn2:multiInstanceLoopCharacteristics isSequentialfalse flowable:collection${multiInstanceHandler.getUserNames(execution)} flowable:elementVariableassignee bpmn2:completionCondition xsi:typebpmn2:tFormalExpression${nrOfCompletedInstances gt; nrOfInstances}/bpmn2:completionCondition /bpmn2:multiInstanceLoopCharacteristics /bpmn2:userTask说明满足需求1的配置flowable:assignee${assignee}${assignee}里面的名称要跟flowable:elementVariableassignee的值一样。isSequentialtruetrue表示顺序执行false表示并行执行。${nrOfCompletedInstances gt; nrOfInstances}表示完成条件为全部实例完成。flowable:candidateUsers分管领导001,部门领导001表示预设处理人为分管领导001,部门领导001。flowable:collection${multiInstanceHandler.getUserNames(execution)}表示处理人的集合这里调用了java代码multiInstanceHandler.getUserNames方法和结合flowable:candidateUsers预设的值返回具体的处理人。下面会贴上代码。满足需求2的配置在上面的配置基础上再加上【执行监听器】配置如下bpmn2:extensionElements flowable:executionListener classcom.cn.workflow.flowable.listener.FlowExecutionListener eventstart / /bpmn2:extensionElements6、代码实现代码由开源项目做二次修改https://gitee.com/nbacheng/ruoyi-nbcio/tree/master/multiInstanceHandler.getUserNames代码Component(multiInstanceHandler) public class MultiInstanceHandler { Autowired private RemoteUserService remoteUserService; Autowired private RemoteDeptService remoteDeptService; public SetString getUserNames(DelegateExecution execution) { SetString candidateUserNames new LinkedHashSet(); FlowElement flowElement execution.getCurrentFlowElement(); if (ObjectUtil.isNotEmpty(flowElement) flowElement instanceof UserTask) { UserTask userTask (UserTask) flowElement; String dataType userTask.getAttributeValue( http://flowable.org/bpmn, dataType); if (USERS.equals(dataType) CollUtil.isNotEmpty(userTask.getCandidateUsers())) { // 添加候选用户 candidateUserNames.addAll(userTask.getCandidateUsers()); } else if (CollUtil.isNotEmpty(userTask.getCandidateGroups())) { // 以下功能可以参考具体逻辑按各自的来处理 // 获取组的ID角色ID集合或部门ID集合 ListLong groups userTask.getCandidateGroups().stream() .map(item - Long.parseLong(item.substring(4))) .collect(Collectors.toList()); ListLong userIds new ArrayList(); if (ROLES.equals(dataType)) { // 通过角色id获取所有用户id集合 RListLong listR remoteUserService.selectUserIdsByRoleIds(groups, SecurityConstants.INNER); userIds listR.getCode() R.SUCCESS ? listR.getData() : new ArrayList(); } else if (DEPTS.equals(dataType)) { // 通过部门id获取所有用户id集合 RListLong listR remoteDeptService.selectUserIdsByDeptIds(groups, SecurityConstants.INNER); userIds listR.getCode() R.SUCCESS ? listR.getData() : new ArrayList(); } // 添加候选用户 RListString listR remoteUserService.selectUserNames(userIds, SecurityConstants.INNER); if(listR.getCode() R.SUCCESS){ ListString userNames listR.getData(); userNames.forEach(userName - candidateUserNames.add(userName)); }else{ throw new ServiceException(候选用户不能为空); } } } return candidateUserNames; } }FlowExecutionListener代码如果配置了【执行监听器】那么程序会先执行FlowExecutionListener再执行multiInstanceHandler.getUserNamesComponent(value flowExecutionListener) public class FlowExecutionListener implements ExecutionListener { Override public void notify(DelegateExecution execution) { FlowElement flowElement execution.getCurrentFlowElement(); if(ObjectUtil.isNotEmpty(flowElement) flowElement instanceof UserTask){ UserTask userTask (UserTask) execution.getCurrentFlowElement(); //这里只做简单的设置办理人 //还可以设置办理组、改变变量dataType的值等 userTask.setCandidateUsers(Arrays.asList(技术部分管领导001,技术部分管领导002,技术部主管领导001)); } System.out.println(执行监听器:{} execution); } }7、流程文件flowable.xml:?xml version1.0 encodingUTF-8? bpmn2:definitions xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:bpmn2http://www.omg.org/spec/BPMN/20100524/MODEL xmlns:bpmndihttp://www.omg.org/spec/BPMN/20100524/DI xmlns:dchttp://www.omg.org/spec/DD/20100524/DC xmlns:dihttp://www.omg.org/spec/DD/20100524/DI xmlns:flowablehttp://flowable.org/bpmn iddiagram_Process_1761616908502 targetNamespacehttp://flowable.org/bpmn xsi:schemaLocationhttp://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd bpmn2:process idProcess_1761616908502 name审批流程 isExecutabletrue bpmn2:startEvent idks name开始 bpmn2:outgoingFlow_0zttbj2/bpmn2:outgoing /bpmn2:startEvent bpmn2:userTask idyg name员工 flowable:dataTypeINITIATOR flowable:assignee${initiator} flowable:text流程发起人 bpmn2:incomingfq/bpmn2:incoming bpmn2:incomingth/bpmn2:incoming bpmn2:outgoingsq/bpmn2:outgoing /bpmn2:userTask bpmn2:userTask idldsp name领导审批 flowable:dataTypeUSERS flowable:assignee${assignee} flowable:candidateUsers分管领导001,部门领导001 flowable:text分管领导001,部门领导001 bpmn2:extensionElements flowable:executionListener classcom.cn.workflow.flowable.listener.FlowExecutionListener eventstart / /bpmn2:extensionElements bpmn2:incomingsq/bpmn2:incoming bpmn2:outgoingFlow_13elc6g/bpmn2:outgoing bpmn2:outgoingth/bpmn2:outgoing bpmn2:multiInstanceLoopCharacteristics flowable:collection${multiInstanceHandler.getUserNames(execution)} flowable:elementVariableassignee bpmn2:completionCondition xsi:typebpmn2:tFormalExpression${nrOfCompletedInstances gt; nrOfInstances}/bpmn2:completionCondition /bpmn2:multiInstanceLoopCharacteristics /bpmn2:userTask bpmn2:endEvent idjs name结束 bpmn2:incomingFlow_13elc6g/bpmn2:incoming /bpmn2:endEvent bpmn2:sequenceFlow idFlow_13elc6g name提交 sourceRefldsp targetRefjs bpmn2:conditionExpression xsi:typebpmn2:tFormalExpression${nextNodeIdjs}/bpmn2:conditionExpression /bpmn2:sequenceFlow bpmn2:sequenceFlow idfq name发起 sourceRefdj targetRefyg / bpmn2:sequenceFlow idsq name申请 sourceRefyg targetRefldsp / bpmn2:sequenceFlow idth name退回 sourceRefldsp targetRefyg bpmn2:conditionExpression xsi:typebpmn2:tFormalExpression${nextNodeIdyg}/bpmn2:conditionExpression /bpmn2:sequenceFlow bpmn2:userTask iddj name登记 flowable:dataTypeINITIATOR flowable:assignee${initiator} flowable:text流程发起人 bpmn2:incomingFlow_0zttbj2/bpmn2:incoming bpmn2:outgoingfq/bpmn2:outgoing /bpmn2:userTask bpmn2:sequenceFlow idFlow_0zttbj2 sourceRefks targetRefdj / /bpmn2:process bpmndi:BPMNDiagram idBPMNDiagram_1 bpmndi:BPMNPlane idBPMNPlane_1 bpmnElementProcess_1761616908502 bpmndi:BPMNEdge idFlow_0zttbj2_di bpmnElementFlow_0zttbj2 di:waypoint x38 y239 / di:waypoint x110 y239 / /bpmndi:BPMNEdge bpmndi:BPMNEdge idth_di bpmnElementth di:waypoint x550 y199 / di:waypoint x550 y170 / di:waypoint x336 y170 / di:waypoint x336 y199 / bpmndi:BPMNLabel dc:Bounds x432 y152 width22 height14 / /bpmndi:BPMNLabel /bpmndi:BPMNEdge bpmndi:BPMNEdge idsq_di bpmnElementsq di:waypoint x386 y239 / di:waypoint x500 y239 / bpmndi:BPMNLabel dc:Bounds x432 y221 width22 height14 / /bpmndi:BPMNLabel /bpmndi:BPMNEdge bpmndi:BPMNEdge idfq_di bpmnElementfq di:waypoint x210 y239 / di:waypoint x286 y239 / bpmndi:BPMNLabel dc:Bounds x235 y221 width22 height14 / /bpmndi:BPMNLabel /bpmndi:BPMNEdge bpmndi:BPMNEdge idFlow_13elc6g_di bpmnElementFlow_13elc6g di:waypoint x600 y239 / di:waypoint x682 y239 / bpmndi:BPMNLabel dc:Bounds x635 y217 width22 height14 / /bpmndi:BPMNLabel /bpmndi:BPMNEdge bpmndi:BPMNShape idks_di bpmnElementks dc:Bounds x2 y221 width36 height36 / bpmndi:BPMNLabel dc:Bounds x10 y264 width22 height14 / /bpmndi:BPMNLabel /bpmndi:BPMNShape bpmndi:BPMNShape idyg_di bpmnElementyg dc:Bounds x286 y199 width100 height80 / /bpmndi:BPMNShape bpmndi:BPMNShape idldsp_di bpmnElementldsp dc:Bounds x500 y199 width100 height80 / /bpmndi:BPMNShape bpmndi:BPMNShape idjs_di bpmnElementjs dc:Bounds x682 y221 width36 height36 / bpmndi:BPMNLabel dc:Bounds x691 y264 width22 height14 / /bpmndi:BPMNLabel /bpmndi:BPMNShape bpmndi:BPMNShape iddj_di bpmnElementdj dc:Bounds x110 y199 width100 height80 / /bpmndi:BPMNShape /bpmndi:BPMNPlane /bpmndi:BPMNDiagram /bpmn2:definitions

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询