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


相关文章
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(简单支持发起人与审批人的流程)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(简单支持发起人与审批人的流程)
1230 2
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(简单支持发起人与审批人的流程)
基于若依的ruoyi-nbcio流程管理系统增加仿钉钉流程设计(七)
基于若依的ruoyi-nbcio流程管理系统增加仿钉钉流程设计(七)
294 1
基于若依的ruoyi-nbcio流程管理系统增加仿钉钉流程设计(七)
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)
1057 3
基于若依的ruoyi-nbcio流程管理系统增加仿钉钉流程设计(六)
基于若依的ruoyi-nbcio流程管理系统增加仿钉钉流程设计(六)
218 0
|
XML JSON 前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
421 3
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(排它条件网关)
|
XML Java Maven
Spring中AOP最简单实例-XML形式
Spring中AOP最简单实例-XML形式
152 0
|
前端开发
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
基于若依的ruoyi-nbcio流程管理系统仿钉钉流程初步完成转bpmn设计(还有bug,以后再修改)
401 0
|
8月前
|
Android开发 开发者
Android自定义View之不得不知道的文件attrs.xml(自定义属性)
本文详细介绍了如何通过自定义 `attrs.xml` 文件实现 Android 自定义 View 的属性配置。以一个包含 TextView 和 ImageView 的 DemoView 为例,讲解了如何使用自定义属性动态改变文字内容和控制图片显示隐藏。同时,通过设置布尔值和点击事件,实现了图片状态的切换功能。代码中展示了如何在构造函数中解析自定义属性,并通过方法 `setSetting0n` 和 `setbackeguang` 实现功能逻辑的优化与封装。此示例帮助开发者更好地理解自定义 View 的开发流程与 attrs.xml 的实际应用。
239 2
Android自定义View之不得不知道的文件attrs.xml(自定义属性)
|
XML 前端开发 Java
讲解SSM的xml文件
本文详细介绍了SSM框架中的xml配置文件,包括springMVC.xml和applicationContext.xml,涉及组件扫描、数据源配置、事务管理、MyBatis集成以及Spring MVC的视图解析器配置。
305 1
|
XML Java 数据格式
Spring5入门到实战------7、IOC容器-Bean管理XML方式(外部属性文件)
这篇文章是Spring5框架的实战教程,主要介绍了如何在Spring的IOC容器中通过XML配置方式使用外部属性文件来管理Bean,特别是数据库连接池的配置。文章详细讲解了创建属性文件、引入属性文件到Spring配置、以及如何使用属性占位符来引用属性文件中的值。
Spring5入门到实战------7、IOC容器-Bean管理XML方式(外部属性文件)