基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)

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

gitee源代码地址

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

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

这个章节来完成并行网关,前端无需修改,直接后端修改就可以了。

1、并行网关后端修改如下:

 String createConcurrentGatewayBuilder(String formId, JSONObject flowNode) throws InvocationTargetException, IllegalAccessException {
        //String name = flowNode.getString("nodeName");
        ParallelGateway parallelGateway = new ParallelGateway();
        String parallelGatewayId = id("parallelGateway");
        parallelGateway.setId(parallelGatewayId);
        parallelGateway.setName("并行网关");
        ddProcess.addFlowElement(parallelGateway);
        ddProcess.addFlowElement(connect(formId, parallelGatewayId));

        if (Objects.isNull(flowNode.getJSONArray("concurrentNodes"))
                && Objects.isNull(flowNode.getJSONObject("childNode"))) {
            return parallelGatewayId;
        }

        List<JSONObject> flowNodes = Optional.ofNullable(flowNode.getJSONArray("concurrentNodes")).map(e -> e.toJavaList(JSONObject.class)).orElse(Collections.emptyList());
        List<String> incoming = Lists.newArrayListWithCapacity(flowNodes.size());
        for (JSONObject element : flowNodes) {
            JSONObject childNode = element.getJSONObject("childNode");
            if (Objects.isNull(childNode)) {
                incoming.add(parallelGatewayId);
                continue;
            }
            String identifier = create(parallelGatewayId, childNode);
            if (Objects.nonNull(identifier)) {
                incoming.add(identifier);
            }
        }

        JSONObject childNode = flowNode.getJSONObject("childNode");
        if (Objects.nonNull(childNode)) {
            // 普通结束网关
            if (CollectionUtils.isEmpty(incoming)) {
                return create(parallelGatewayId, childNode);
            } else {
                // 所有 service task 连接 end parallel gateway
                childNode.put("incoming", incoming);
                FlowElement flowElement = ddBpmnModel.getFlowElement(incoming.get(0));
                // 1.0 先进行边连接, 暂存 nextNode
                JSONObject nextNode = childNode.getJSONObject("childNode");
                childNode.put("childNode", null);
                String identifier = create(incoming.get(0), childNode);
                for (int i = 1; i < incoming.size(); i++) {
                    FlowElement flowElement1 = ddBpmnModel.getFlowElement(incoming.get(i));
                    ddProcess.addFlowElement(connect(flowElement1.getId(), identifier));
                }
                // 1.1 边连接完成后,在进行 nextNode 创建
                if (Objects.nonNull(nextNode)) {
                    return create(identifier, nextNode);
                } else {
                    return identifier;
                }
            }
        }
        return parallelGatewayId;
    }

2、效果图如下:

3、生产的xml如下:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/test">
  <process id="Process_1233c789-c986-4de2-8ab2-9c24ef0a2312" name="dingding演示流程" isExecutable="true">
    <startEvent id="start_36faea0bc7344384bc52078dd43c0829"></startEvent>
    <parallelGateway id="parallelGateway_31fb5c2d6062402688b9bceb230610df" name="并行网关"></parallelGateway>
    <sequenceFlow id="sequenceFlow_8f3fb2e6498847aea4e88ad7f8527720" sourceRef="start_36faea0bc7344384bc52078dd43c0829" targetRef="parallelGateway_31fb5c2d6062402688b9bceb230610df"></sequenceFlow>
    <userTask id="userTask_261260b7d3c643f08d6000f422628363" name="审批人" flowable:assignee="ry" flowable:dataType="USERS" flowable:text="若依"></userTask>
    <sequenceFlow id="sequenceFlow_ec473d524b1f4c70ac8d59c9d11cf20a" sourceRef="parallelGateway_31fb5c2d6062402688b9bceb230610df" targetRef="userTask_261260b7d3c643f08d6000f422628363"></sequenceFlow>
    <userTask id="userTask_182b04b3cc0c465589ae5bb936185fe5" name="审批人" flowable:assignee="zhangsan" flowable:dataType="USERS" flowable:text="张三"></userTask>
    <sequenceFlow id="sequenceFlow_9c0f2e6f0a434217996502850297b251" sourceRef="parallelGateway_31fb5c2d6062402688b9bceb230610df" targetRef="userTask_182b04b3cc0c465589ae5bb936185fe5"></sequenceFlow>
    <userTask id="userTask_d81ef1ca0fa2436abf543dc6cb7d80df" name="审批人" flowable:assignee="admin" flowable:dataType="USERS" flowable:text="若依管理员"></userTask>
    <sequenceFlow id="sequenceFlow_2227bd432d044dc889aa9a9132ca7589" sourceRef="userTask_261260b7d3c643f08d6000f422628363" targetRef="userTask_d81ef1ca0fa2436abf543dc6cb7d80df"></sequenceFlow>
    <sequenceFlow id="sequenceFlow_8bb051d48a654b3bba4a687c6320eb29" sourceRef="userTask_182b04b3cc0c465589ae5bb936185fe5" targetRef="userTask_d81ef1ca0fa2436abf543dc6cb7d80df"></sequenceFlow>
    <endEvent id="end_28c4b21fe4d145cfb6aa1019d13a24ac"></endEvent>
    <sequenceFlow id="sequenceFlow_008d4f7e2c0e4246af7d5c4092af6a21" sourceRef="userTask_d81ef1ca0fa2436abf543dc6cb7d80df" targetRef="end_28c4b21fe4d145cfb6aa1019d13a24ac"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_Process_1233c789-c986-4de2-8ab2-9c24ef0a2312">
    <bpmndi:BPMNPlane bpmnElement="Process_1233c789-c986-4de2-8ab2-9c24ef0a2312" id="BPMNPlane_Process_1233c789-c986-4de2-8ab2-9c24ef0a2312">
      <bpmndi:BPMNShape bpmnElement="start_36faea0bc7344384bc52078dd43c0829" id="BPMNShape_start_36faea0bc7344384bc52078dd43c0829">
        <omgdc:Bounds height="30.0" width="30.0" x="0.0" y="95.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="userTask_d81ef1ca0fa2436abf543dc6cb7d80df" id="BPMNShape_userTask_d81ef1ca0fa2436abf543dc6cb7d80df">
        <omgdc:Bounds height="60.0" width="100.0" x="320.0" y="80.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="userTask_182b04b3cc0c465589ae5bb936185fe5" id="BPMNShape_userTask_182b04b3cc0c465589ae5bb936185fe5">
        <omgdc:Bounds height="60.0" width="100.0" x="170.0" y="160.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="parallelGateway_31fb5c2d6062402688b9bceb230610df" id="BPMNShape_parallelGateway_31fb5c2d6062402688b9bceb230610df">
        <omgdc:Bounds height="40.0" width="40.0" x="80.0" y="90.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="userTask_261260b7d3c643f08d6000f422628363" id="BPMNShape_userTask_261260b7d3c643f08d6000f422628363">
        <omgdc:Bounds height="60.0" width="100.0" x="170.0" y="0.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="end_28c4b21fe4d145cfb6aa1019d13a24ac" id="BPMNShape_end_28c4b21fe4d145cfb6aa1019d13a24ac">
        <omgdc:Bounds height="30.0" width="30.0" x="470.0" y="95.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_8bb051d48a654b3bba4a687c6320eb29" id="BPMNEdge_sequenceFlow_8bb051d48a654b3bba4a687c6320eb29">
        <omgdi:waypoint x="270.0" y="190.0"></omgdi:waypoint>
        <omgdi:waypoint x="282.0" y="190.0"></omgdi:waypoint>
        <omgdi:waypoint x="282.0" y="110.0"></omgdi:waypoint>
        <omgdi:waypoint x="320.0" y="110.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_8f3fb2e6498847aea4e88ad7f8527720" id="BPMNEdge_sequenceFlow_8f3fb2e6498847aea4e88ad7f8527720">
        <omgdi:waypoint x="30.0" y="110.0"></omgdi:waypoint>
        <omgdi:waypoint x="80.0" y="110.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_ec473d524b1f4c70ac8d59c9d11cf20a" id="BPMNEdge_sequenceFlow_ec473d524b1f4c70ac8d59c9d11cf20a">
        <omgdi:waypoint x="120.0" y="102.5"></omgdi:waypoint>
        <omgdi:waypoint x="132.0" y="102.5"></omgdi:waypoint>
        <omgdi:waypoint x="132.0" y="30.000000000000007"></omgdi:waypoint>
        <omgdi:waypoint x="170.0" y="30.000000000000007"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_9c0f2e6f0a434217996502850297b251" id="BPMNEdge_sequenceFlow_9c0f2e6f0a434217996502850297b251">
        <omgdi:waypoint x="120.0" y="117.5"></omgdi:waypoint>
        <omgdi:waypoint x="132.0" y="117.5"></omgdi:waypoint>
        <omgdi:waypoint x="132.0" y="190.0"></omgdi:waypoint>
        <omgdi:waypoint x="170.0" y="190.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_008d4f7e2c0e4246af7d5c4092af6a21" id="BPMNEdge_sequenceFlow_008d4f7e2c0e4246af7d5c4092af6a21">
        <omgdi:waypoint x="420.0" y="110.0"></omgdi:waypoint>
        <omgdi:waypoint x="470.0" y="110.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sequenceFlow_2227bd432d044dc889aa9a9132ca7589" id="BPMNEdge_sequenceFlow_2227bd432d044dc889aa9a9132ca7589">
        <omgdi:waypoint x="270.0" y="30.0"></omgdi:waypoint>
        <omgdi:waypoint x="282.0" y="30.0"></omgdi:waypoint>
        <omgdi:waypoint x="282.0" y="110.0"></omgdi:waypoint>
        <omgdi:waypoint x="320.0" y="110.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

4、在原来流程设计器打开如下:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/130900.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

C#开发的OpenRA游戏之世界存在的属性CombatDebugOverlay(3)

C#开发的OpenRA游戏之世界存在的属性CombatDebugOverlay(3) 这次来分析CombatDebugOverlay属性,这个属性只有在调试游戏的时候才会使用。当你设置这个属性的时候,就可以看到如下图的结果: 可以看到物品的周边都有一个圆圈,以及有一些十字的点位标志。 那些十字表示的点…

【ATTCK】MITRE Caldera 朴素贝叶斯规划器

CALDERA是一个由python语言编写的红蓝对抗工具&#xff08;攻击模拟工具&#xff09;。它是MITRE公司发起的一个研究项目&#xff0c;该工具的攻击流程是建立在ATT&CK攻击行为模型和知识库之上的&#xff0c;能够较真实地APT攻击行为模式。 通过CALDERA工具&#xff0c;安全…

C++源文件的编译过程 学习 CMake 文档的前置知识

OHHHH&#xff0c;发现自己的基础知识真他妈的是呼呼漏风&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c;&#xff0c; 尴尬得意识到&#xff0c;不仅是英语水平有问题&#xff0c;他码的基础知识…

Web实验总

目录 网站需求&#xff1a; 思路&#xff1a; 实验步骤&#xff1a; 第一步&#xff1a;准备工作 第二步&#xff1a;新建一个存储网页的目录 第三步&#xff1a;修改本地hosts映射 第四步&#xff1a;修改配置文件&#xff0c;建立基于http服务的网站 1)创建用户song和…

iOS移动应用安全加固:保护您的App免受恶意攻击的重要步骤

目录 iOS移动应用安全加固&#xff1a;保护您的App免受恶意攻击的重要步骤 摘要 引言 一、APP加固的概念 二、APP加固方案的比较 三、保护iOS应用的安全 四、总结 参考资料 摘要 本文介绍了移动应用程序&#xff08;App&#xff09;加固的概念和流程&#xff0c;以及市…

[模版总结] - 树的基本算法1 - 遍历

树结构定义 一种非线性存储结构&#xff0c;具有存储“一对多”关系的数据元素集合 种类 General Tree TrieB/B 树二叉树 满/完满/完全二叉树 完美BT : 除了叶子结点外所有节点都有两个字节点&#xff0c;每一层都完满填充完全BT&#xff1a; 除最后一层以外其他每一层都完美…

单元测试工具-Junit

文章目录 一. 认识Junit二. Junit中常用的注解1. Test2. Disabled3. BeforeAll & AfterAll4. BeforeEach & AfterEach 三. ParameterizedTest参数化1. 单参数2. 多参数2.1. CSV 获取参数2.2. 方法获取参数 四. Order控制测试用例的执行顺序五. 断言六. 测试套件1. 通过…

Docker进阶——再次认识docker的概念 Docker的结构 Docker镜像结构 镜像的构建方式

前言 在微服务大量应用的互联网时代&#xff0c;经常能看到docker的身影。作为docker的爱好者&#xff08;在服务器安装MySQL&#xff0c;Redis。。。我用的都是docker&#xff09;&#xff0c;我也会持续深入学习和认识docker。 本篇博客再次介绍docker的基本概念&#xff0…

SmartBear正式收购Stoplight,并计划在核心API设计、文档和门户产品中集成其功能

不久前&#xff0c;软件开发和可视化工具提供商SmartBear正式宣布收购全球领先的API设计公司Stoplight。这一收购是为了打造业内最全面的API开发平台&#xff0c;为寻求现代化API实践的开发团队提供更好的透明度、自动化与生产力。将Stoplight在API方面的优势&#xff08;包括治…

吴恩达《机器学习》7-1->7-4:过拟合问题、代价函数、线性回归的正则化、正则化的逻辑回归模型

一、过拟合的本质 过拟合是指模型在训练集上表现良好&#xff0c;但在新数据上的泛化能力较差。考虑到多项式回归的例子&#xff0c;我们可以通过几个模型的比较来理解过拟合的本质。 线性模型&#xff08;欠拟合&#xff09;&#xff1a; 第一个模型是一个线性模型&#xff0…

Elasticsearch:Lucene 中引入标量量化

作者&#xff1a;BENJAMIN TRENT 我们如何将标量量化引入 Lucene。 Lucene 中的自动字节量化 虽然 HNSW 是一种强大而灵活的存储和搜索向量的方法&#xff0c;但它确实需要大量内存才能快速运行。 例如&#xff0c;查询 768 维的 1MM float32 向量大约需要 1,000,000*4*(7681…

多维时序 | MATLAB实现TCN时间卷积神经网络多变量时间序列预测

多维时序 | MATLAB实现TCN时间卷积神经网络多变量时间序列预测 目录 多维时序 | MATLAB实现TCN时间卷积神经网络多变量时间序列预测预测效果基本介绍模型描述程序设计参考资料 预测效果 基本介绍 MATLAB实现TCN时间卷积神经网络多变量时间序列预测 模型描述 MATLAB实现TCN时间卷…

3.前端调式(断点调式)

1. Elements 先来看这张图最上头的一行是一个功能菜单&#xff0c;每一个菜单都有它相应的功能和使用方法&#xff0c;依次从左往右来看 箭头按钮 用于在页面选择一个元素来审查和查看它的相关信息&#xff0c;当我们在Elements这个按钮页面下点击某个Dom元素时&#xff0c;箭…

ubuntu16.04安装vscode遇到的code 依赖于 libnss3 (>= 2:3.30)解决

1、ubuntu16.04安装最新版本vscode失败原因 ubuntu16.04安装最新版本的vscode会遇到依赖libnss3(>2:3.30)的问题&#xff0c;原因是ubuntu16.04安装的库libnss3版本更低&#xff0c;与vscode需要的更高版本的libnss3库不兼容&#xff0c;只需要升级libnss3库版本高于2:3.30…

PROFINET和UDP、MODBUS-RTU通信速度对比实验

这篇博客我们介绍PROFINET 和MODBUS-RTU通信实验时的数据刷新速度,以及这种速度不同对控制系统带来的挑战都有哪些,在介绍这篇对比实验之前大家可以参考下面的文章链接: S7-1200PLC和SMART PLC的PN智能从站通信 S7-200 SMART 和 S7-1200PLC进行PROFINET IO通信-CSDN博客文…

LeetCode(4)删除有序数组中的重复项 II【数组/字符串】【中等】

目录 1.题目2.答案3.提交结果截图 链接&#xff1a; 80. 删除有序数组中的重复项 II 1.题目 给你一个有序数组 nums &#xff0c;请你** 原地** 删除重复出现的元素&#xff0c;使得出现次数超过两次的元素只出现两次 &#xff0c;返回删除后数组的新长度。 不要使用额外的数…

Ubuntu18.04.6安装qt5.7.1(超级详细教程)

目录 1、下载对应Linux版本的qt 2、安装完qt&#xff0c;可能也要安装下对应的编译工具 1、下载对应Linux版本的qt &#xff08;1&#xff09;准备安装的是qt5.7.1&#xff1a;qt-opensource-linux-x64-5.7.1.run &#xff08;2&#xff09;在虚拟机进入存放qt安装包的目录…

Linux安装MySQL8.0服务

Linux安装MySQL8.0服务 文章目录 Linux安装MySQL8.0服务一、卸载1.1 查看mariadb1.2 卸载 二、安装2.1 下载2.2 上传2.3 解压2.4 重命名2.5 删除2.6 创建目录2.7 环境变量2.8 修改配置2.9 配置文件2.9 用户与用户组2.10 初始化2.11 其它 三、开启远程连接MySQL 一、卸载 首先第…

springcloud图书借阅管理系统源码

开发说明&#xff1a; jdk1.8&#xff0c;mysql5.7&#xff0c;nodejs&#xff0c;idea&#xff0c;nodejs&#xff0c;vscode springcloud springboot mybatis vue elementui 功能介绍&#xff1a; 用户端&#xff1a; 登录注册 首页显示搜索图书&#xff0c;轮播图&…

地区 IP 库

地区 & IP 库 yudao-spring-boot-starter-biz-ip (opens new window)业务组件&#xff0c;提供地区 & IP 库的封装。 #1. 地区 AreaUtils (opens new window)是地区工具类&#xff0c;可以查询中国的省、市、区县&#xff0c;也可以查询国外的国家。 它的数据来自 …