基于若依的ruoyi-nbcio流程管理系统里修正仿钉钉流程部门主管与多实例转xml的bug

简介: 基于若依的ruoyi-nbcio流程管理系统里修正仿钉钉流程部门主管与多实例转xml的bug

更多ruoyi-nbcio功能请看演示系统

gitee源代码地址

前后端代码: https://gitee.com/nbacheng/ruoyi-nbcio

演示地址:RuoYi-Nbcio后台管理系统

更多nbcio-boot功能请看演示系统

gitee源代码地址

后端代码: https://gitee.com/nbacheng/nbcio-boot

前端代码:https://gitee.com/nbacheng/nbcio-vue.git

在线演示(包括H5) : http://218.75.87.38:9888

1、后端代码 createUserTask方法里修正如下:

根据不通类型进行分别判断出来xml生成

String assignType = properties.getString("assigneeType");
            if(StringUtils.equalsAnyIgnoreCase("user", assignType)) {
              JSONArray approvers = properties.getJSONArray("approvers");
              JSONObject approver = approvers.getJSONObject(0);
              ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();
              extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extDataTypeAttribute.setName("dataType");
              extDataTypeAttribute.setValue("USERS");
              userTask.addAttribute(extDataTypeAttribute);
              ExtensionAttribute extTextAttribute =  new ExtensionAttribute();
              extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extTextAttribute.setName("text");
              extTextAttribute.setValue(approver.getString("nickName"));
              userTask.addAttribute(extTextAttribute);
              userTask.setFormKey(properties.getString("formKey"));
              userTask.setAssignee(approver.getString("userName"));
            }
            else if (StringUtils.equalsAnyIgnoreCase("director", assignType)) {
              ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();
              extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extDataTypeAttribute.setName("dataType");
              extDataTypeAttribute.setValue("MANAGER");
              userTask.addAttribute(extDataTypeAttribute);
              ExtensionAttribute extTextAttribute =  new ExtensionAttribute();
              extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extTextAttribute.setName("text");
              extTextAttribute.setValue("部门经理");
              userTask.addAttribute(extTextAttribute);
              userTask.setFormKey(properties.getString("formKey"));
              userTask.setAssignee("${DepManagerHandler.getUser(execution)}");
            }
            else if (StringUtils.equalsAnyIgnoreCase("role", assignType)) {
              JSONArray approvers = properties.getJSONArray("approvers");
              JSONObject approver = approvers.getJSONObject(0);
              ExtensionAttribute extDataTypeAttribute =  new ExtensionAttribute();
              extDataTypeAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extDataTypeAttribute.setName("dataType");
              extDataTypeAttribute.setValue("ROLES");
              userTask.addAttribute(extDataTypeAttribute);
              ExtensionAttribute extTextAttribute =  new ExtensionAttribute();
              extTextAttribute.setNamespace(ProcessConstants.NAMASPASE);
              extTextAttribute.setName("text");
              extTextAttribute.setValue(approver.getString("roleName"));
              userTask.addAttribute(extTextAttribute);
              userTask.setFormKey(properties.getString("formKey"));
              List<SysRole> sysroleslist = approvers.toJavaList(SysRole.class);
              List<String> roleslist = sysroleslist.stream().map(e->e.getRoleKey()).collect(Collectors.toList());
              userTask.setCandidateGroups(roleslist);
              userTask.setAssignee("${assignee}");
              MultiInstanceLoopCharacteristics loopCharacteristics = new MultiInstanceLoopCharacteristics();
              if(StringUtils.equalsAnyIgnoreCase(properties.getString("counterSign"), "true")) {//并行会签
                loopCharacteristics.setSequential(false);
                loopCharacteristics.setInputDataItem("${multiInstanceHandler.getUserNames(execution)}");
                loopCharacteristics.setElementVariable("assignee");
                loopCharacteristics.setCompletionCondition("${nrOfCompletedInstances &gt;= nrOfInstances}");
              }
              else {
                loopCharacteristics.setSequential(false);
                loopCharacteristics.setInputDataItem("${multiInstanceHandler.getUserNames(execution)}");
                loopCharacteristics.setElementVariable("assignee");
                loopCharacteristics.setCompletionCondition("${nrOfCompletedInstances &gt; 0}");
              }
              userTask.setLoopCharacteristics(loopCharacteristics);
            }

2、部门主管效果图

3、多实例效果图


相关文章
|
8天前
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)
41 3
|
8天前
|
前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
12 0
|
8天前
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
13 3
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
|
存储 弹性计算 安全
成功案例-钉钉 | 学习笔记
快速学习 成功案例-钉钉
300 0
|
存储 弹性计算 安全
案例分享——钉钉|学习笔记
快速学习 案例分享——钉钉
279 0
|
移动开发 物联网 Go
SAP Business ByDesign 和支付宝与钉钉集成的一个原型开发案例
SAP Business ByDesign 和支付宝与钉钉集成的一个原型开发案例
SAP Business ByDesign 和支付宝与钉钉集成的一个原型开发案例
|
移动开发 物联网 智能硬件
SAP Business ByDesign 和支付宝与钉钉集成的一个原型开发案例
SAP Business ByDesign 和支付宝与钉钉集成的一个原型开发案例
189 0
SAP Business ByDesign 和支付宝与钉钉集成的一个原型开发案例
|
存储 弹性计算 监控
|
存储 弹性计算 安全
了解成功案例-钉钉(进阶班-Day6)
钉钉使用阿里云而成功的案例主要介绍了: 1、钉钉背后的技术架构 2、使用阿里云(云计算)后为钉钉解决的问题(主要是安全可靠性) 3、钉钉
604 0