基于若依的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、多实例效果图


相关文章
|
4月前
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)
235 3
|
26天前
|
XML 算法 API
访问者模式问题之钉钉审批流程配置为什么适合使用访问者模式
访问者模式问题之钉钉审批流程配置为什么适合使用访问者模式
|
4月前
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
85 3
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
|
4月前
|
前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
57 0
|
1月前
|
XML Java 数据格式
Spring5入门到实战------7、IOC容器-Bean管理XML方式(外部属性文件)
这篇文章是Spring5框架的实战教程,主要介绍了如何在Spring的IOC容器中通过XML配置方式使用外部属性文件来管理Bean,特别是数据库连接池的配置。文章详细讲解了创建属性文件、引入属性文件到Spring配置、以及如何使用属性占位符来引用属性文件中的值。
Spring5入门到实战------7、IOC容器-Bean管理XML方式(外部属性文件)
|
3月前
|
XML Java 数据格式
java创建xml文件内容
java创建xml文件内容
|
3月前
|
XML Java 数据格式
java解析xml文件内容
java解析xml文件内容
|
20天前
|
SQL XML Java
mybatis :sqlmapconfig.xml配置 ++++Mapper XML 文件(sql/insert/delete/update/select)(增删改查)用法
当然,这些仅是MyBatis功能的初步介绍。MyBatis还提供了高级特性,如动态SQL、类型处理器、插件等,可以进一步提供对数据库交互的强大支持和灵活性。希望上述内容对您理解MyBatis的基本操作有所帮助。在实际使用中,您可能还需要根据具体的业务要求调整和优化SQL语句和配置。
26 1
|
1月前
|
XML 监控 数据格式
ROS 2 - Python、XML 和 YAML 编写 Launch 文件
ROS 2 - Python、XML 和 YAML 编写 Launch 文件
154 0
|
3月前
|
XML Java 数据库
配置applicationContext.xml文件
配置applicationContext.xml文件