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

本文主要是介绍基于若依的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 gatewaychildNode.put("incoming", incoming);FlowElement flowElement = ddBpmnModel.getFlowElement(incoming.get(0));// 1.0 先进行边连接, 暂存 nextNodeJSONObject 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、在原来流程设计器打开如下:

这篇关于基于若依的ruoyi-nbcio流程管理系统仿钉钉流程json转bpmn的flowable的xml格式(支持并行网关)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/383344

相关文章

Security OAuth2 单点登录流程

单点登录(英语:Single sign-on,缩写为 SSO),又译为单一签入,一种对于许多相互关连,但是又是各自独立的软件系统,提供访问控制的属性。当拥有这项属性时,当用户登录时,就可以获取所有系统的访问权限,不用对每个单一系统都逐一登录。这项功能通常是以轻型目录访问协议(LDAP)来实现,在服务器上会将用户信息存储到LDAP数据库中。相同的,单一注销(single sign-off)就是指

Spring Security基于数据库验证流程详解

Spring Security 校验流程图 相关解释说明(认真看哦) AbstractAuthenticationProcessingFilter 抽象类 /*** 调用 #requiresAuthentication(HttpServletRequest, HttpServletResponse) 决定是否需要进行验证操作。* 如果需要验证,则会调用 #attemptAuthentica

Vue3项目开发——新闻发布管理系统(六)

文章目录 八、首页设计开发1、页面设计2、登录访问拦截实现3、用户基本信息显示①封装用户基本信息获取接口②用户基本信息存储③用户基本信息调用④用户基本信息动态渲染 4、退出功能实现①注册点击事件②添加退出功能③数据清理 5、代码下载 八、首页设计开发 登录成功后,系统就进入了首页。接下来,也就进行首页的开发了。 1、页面设计 系统页面主要分为三部分,左侧为系统的菜单栏,右侧

工厂ERP管理系统实现源码(JAVA)

工厂进销存管理系统是一个集采购管理、仓库管理、生产管理和销售管理于一体的综合解决方案。该系统旨在帮助企业优化流程、提高效率、降低成本,并实时掌握各环节的运营状况。 在采购管理方面,系统能够处理采购订单、供应商管理和采购入库等流程,确保采购过程的透明和高效。仓库管理方面,实现库存的精准管理,包括入库、出库、盘点等操作,确保库存数据的准确性和实时性。 生产管理模块则涵盖了生产计划制定、物料需求计划、

intellij idea generatorConfig.xml

generatorConfig.xml <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-ge

easyui同时验证账户格式和ajax是否存在

accountName: {validator: function (value, param) {if (!/^[a-zA-Z][a-zA-Z0-9_]{3,15}$/i.test(value)) {$.fn.validatebox.defaults.rules.accountName.message = '账户名称不合法(字母开头,允许4-16字节,允许字母数字下划线)';return fal

kubelet组件的启动流程源码分析

概述 摘要: 本文将总结kubelet的作用以及原理,在有一定基础认识的前提下,通过阅读kubelet源码,对kubelet组件的启动流程进行分析。 正文 kubelet的作用 这里对kubelet的作用做一个简单总结。 节点管理 节点的注册 节点状态更新 容器管理(pod生命周期管理) 监听apiserver的容器事件 容器的创建、删除(CRI) 容器的网络的创建与删除

STL经典案例(四)——实验室预约综合管理系统(项目涉及知识点很全面,内容有点多,耐心看完会有收获的!)

项目干货满满,内容有点过多,看起来可能会有点卡。系统提示读完超过俩小时,建议分多篇发布,我觉得分篇就不完整了,失去了这个项目的灵魂 一、需求分析 高校实验室预约管理系统包括三种不同身份:管理员、实验室教师、学生 管理员:给学生和实验室教师创建账号并分发 实验室教师:审核学生的预约申请 学生:申请使用实验室 高校实验室包括:超景深实验室(可容纳10人)、大数据实验室(可容纳20人)、物联网实验

火语言RPA流程组件介绍--浏览网页

🚩【组件功能】:浏览器打开指定网址或本地html文件 配置预览 配置说明 网址URL 支持T或# 默认FLOW输入项 输入需要打开的网址URL 超时时间 支持T或# 打开网页超时时间 执行后后等待时间(ms) 支持T或# 当前组件执行完成后继续等待的时间 UserAgent 支持T或# User Agent中文名为用户代理,简称 UA,它是一个特殊字符串头,使得服务器

php中json_decode()和json_encode()

1.json_decode() json_decode (PHP 5 >= 5.2.0, PECL json >= 1.2.0) json_decode — 对 JSON 格式的字符串进行编码 说明 mixed json_decode ( string $json [, bool $assoc ] ) 接受一个 JSON 格式的字符串并且把它转换为 PHP 变量 参数 json