美文网首页
vue BPMN 使用

vue BPMN 使用

作者: 码农界四爷__King | 来源:发表于2023-12-18 14:18 被阅读0次

npm 安装 bpmn

npm install bpmn-js@7.3.1 bpmn-js-properties-panel@0.37.2 camunda-bpmn-moddle@4.4.0

bpmnDemo.vue

<template>
    <div class="containers">
        <img :src="imageSrc" alt="" srcset="" style="width: 100px;height: 100px;" v-if="imageSrc">
        <button type="primary" @click="submitPic()">保存XML</button>
        <button type="primary" @click="downloadBpmn()">下载XML</button>
        <button type="primary" @click="downloadSvg()">下载SVG</button>
        <button type="primary" @click="downloadImage()">下载图片</button>
        <button type="primary" @click="handlerUndo()">撤销</button>
        <button type="primary" @click="handlerRedo()">恢复</button>
        <button type="primary" @click="handlerZoom(0.1)">放大</button>
        <button type="primary" @click="handlerZoom(-0.1)">缩小</button>
        <button type="primary" @click="handlerZoom(0)">还原</button>
        <!-- canvas: bpmn容器 -->
        <div class="canvas" ref="canvas" id="canvas" />
        <!-- propertiesPanel: 右侧属性栏容器 -->
        <div id="propertiesPanel" class="panel"></div>

        <a hidden ref="downloadLink"></a>
    </div>
</template>

<script>
    import BpmnModeler from "bpmn-js/lib/Modeler"; // bpmn-js 设计器
    // propertiesPanelModule propertiesProviderModule camundaModdleDescriptor 引入右侧属性栏依赖
    import propertiesPanelModule from "bpmn-js-properties-panel";
    import propertiesProviderModule from "bpmn-js-properties-panel/lib/provider/camunda";
    import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda.json';
    import {
        bpmnXmlStr
    } from './children/initXmlString'; // 初始化流程模板
    import customTranslate from './children/customTranslate'; //汉化包引入
    export default {
        data() {
            return {
                bpmnModeler: null, // bpmn建模器
                scale: 1,
                imageSrc: ""
            };
        },
        mounted() {
            this.initModeler();
        },
        methods: {
            initModeler() {
                // 配置汉化
                const customTranslateModule = {
                    translate: ['value', customTranslate]
                }
                // 生成实例
                this.bpmnModeler = new BpmnModeler({
                    container: "#canvas",
                    propertiesPanel: {
                        parent: "#propertiesPanel"
                    },
                    additionalModules: [
                        // 植入汉化包
                        customTranslateModule,
                        propertiesPanelModule,
                        propertiesProviderModule
                    ],
                    moddleExtensions: {
                        camunda: camundaModdleDescriptor
                    },
                    // 打开键盘快捷键
                    keyboard: {
                        bindTo: document // 或者window,注意与外部表单的键盘监听事件是否冲突
                    }
                });
                // 将初始化的模板引入,在页面初始化时会加载初始化流程模板的内容
                this.initXML();
            },

            initXML() {
                console.log(bpmnXmlStr)
                this.bpmnModeler.importXML(bpmnXmlStr, err => {
                    if (err) {
                        console.error(err);
                        console.error("初始化模板异常");
                    }
                });
            },

            // 保存XML
            submitPic: function() {
                this.bpmnModeler.saveXML({
                    format: true
                }).then((res) => {
                    console.log('保存xml数据:', res.xml);

                });

                this.bpmnModeler.saveXML({
                    format: true
                }, (err, xml) => {
                    if (!err) {
                        let bpmnFile = new File([xml], `${this.getFilename(xml)}bpmn20.xml`, {
                            type: 'text/xml'
                        });
                        //  使用 FormData 将文件作为流的形式传输到后端
                        let formData = new FormData();
                        formData.append('file', bpmnFile);
                        console.log('保存数据:', formData, bpmnFile);
                    }
                });
            },

            // 下载XML
            downloadBpmn() {
                this.bpmnModeler.saveXML({
                    format: true
                }, (err, xml) => {
                    if (!err) {
                        // 获取文件名
                        const name = `${this.getFilename(xml)}bpmn20.xml`;
                        // 将文件名以及数据交给下载方法
                        this.download({
                            name: name,
                            data: xml
                        });
                    }
                });
            },

            getFilename(xml) {
                let start = xml.indexOf('process');
                let filename = xml.substr(start, xml.indexOf('>'));
                filename = filename.substr(filename.indexOf('id') + 4);
                filename = filename.substr(0, filename.indexOf('"'));
                return filename;
            },

            download({
                name = 'diagram.bpmn',
                data
            }) {
                // 这里就获取到了之前设置的隐藏链接
                const downloadLink = this.$refs.downloadLink;
                // 把输就转换为URI,下载要用到的
                const encodedData = encodeURIComponent(data);

                if (data) {
                    // 将数据给到链接
                    downloadLink.href = 'data:application/bpmn20.xml;charset=UTF-8,' + encodedData;
                    // 设置文件名
                    downloadLink.download = name;
                    // 触发点击事件开始下载
                    downloadLink.click();
                }
            },

            // 保存svg
            downloadSvg() {
                let This = this
                This.bpmnModeler.get('canvas').zoom('fit-viewport');
                This.bpmnModeler.saveXML({
                    format: true
                }, (err, xml) => {
                    if (!err) {
                        // 获取文件名
                        const name = `${This.getFilename(xml)}.svg`;

                        // 从建模器画布中提取svg图形标签
                        let canvas = This.bpmnModeler.get('canvas');
                        canvas.zoom('fit-viewport', 'auto');
                        let context = '';
                        const djsGroupAll = This.$refs.canvas.querySelectorAll('.djs-group');
                        for (let item of djsGroupAll) {
                            context += item.innerHTML;
                        }
                        // 获取svg的基本数据,长宽高
                        const viewport = This.$refs.canvas.querySelector('.viewport').getBBox();

                        // 将标签和数据拼接成一个完整正常的svg图形
                        const svg = `
                                    <svg
                                      xmlns="http://www.w3.org/2000/svg"
                                      xmlns:xlink="http://www.w3.org/1999/xlink"
                                      width="${viewport.width}"
                                      height="${viewport.height}"
                                      viewBox="${viewport.x} ${viewport.y} ${viewport.width} ${viewport.height}"
                                      version="1.1"
                                      >
                                      ${context}
                                    </svg>
                                  `;
                        // 将文件名以及数据交给下载方法
                        this.download({
                            name: name,
                            data: svg
                        });
                    }
                });
            },

            // 保存图片
            downloadImage() {
                let This = this
                This.bpmnModeler.get('canvas').zoom('fit-viewport');
                This.bpmnModeler.saveXML({
                    format: true
                }, (err, xml) => {
                    if (!err) {
                        // 获取文件名
                        // const name = `${This.getFilename(xml)}.svg`;
                        const name = This.getFilename(xml);

                        // 从建模器画布中提取svg图形标签
                        let canvas = This.bpmnModeler.get('canvas');
                        canvas.zoom('fit-viewport', 'auto');
                        let context = '';
                        const djsGroupAll = This.$refs.canvas.querySelectorAll('.djs-group');
                        for (let item of djsGroupAll) {
                            context += item.innerHTML;
                        }
                        // 获取svg的基本数据,长宽高
                        const viewport = This.$refs.canvas.querySelector('.viewport').getBBox();

                        // 将标签和数据拼接成一个完整正常的svg图形
                        const svg = `
                                    <svg
                                      xmlns="http://www.w3.org/2000/svg"
                                      xmlns:xlink="http://www.w3.org/1999/xlink"
                                      width="${viewport.width}"
                                      height="${viewport.height}"
                                      viewBox="${viewport.x} ${viewport.y} ${viewport.width} ${viewport.height}"
                                      version="1.1"
                                      >
                                      ${context}
                                    </svg>
                                  `;
                        // 将文件名以及数据交给下载方法
                        console.log(name)
                        console.log(svg)
                        this.covertSVG2Image(svg, name, viewport.width, viewport.height, "png")
                    }
                });
            },

            covertSVG2Image(source, name, width, height, type = 'png') {
                let image = new Image()
                image.src = 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(source)
                let canvas = document.createElement('canvas')
                canvas.width = width
                canvas.height = height
                let context = canvas.getContext('2d')
                context.fillStyle = '#fff'
                context.fillRect(0, 0, 10000, 10000)
                image.onload = function() {
                    context.drawImage(image, 0, 0)
                    let a = document.createElement('a')
                    a.download = `${name}.${type}`
                    a.href = canvas.toDataURL(`image/${type}`)
                    a.click()
                }
            },

            // 恢复
            handlerRedo() {
                this.bpmnModeler.get('commandStack').redo();
            },

            // 撤销
            handlerUndo() {
                this.bpmnModeler.get('commandStack').undo();
            },

            // 放大 缩小 还原
            handlerZoom(radio) {
                const newScale = !radio ? 1.0 : this.scale + radio;
                console.log(newScale)
                this.bpmnModeler.get('canvas').zoom(newScale);
                this.scale = newScale;
                /* const taskTool = document.querySelector('.bpmn-icon-screw-wrench');
                console.log('taskTool', taskTool);
                const taskTool1 = document.querySelector('.bpmn-icon-intermediate-event-none');
                console.log('taskTool1', taskTool1);
                taskTool.remove();
                taskTool1.remove(); */
            },
        },

    };
</script>

<style scoped>
    /*左边工具栏以及编辑节点的样式*/
    @import "~bpmn-js/dist/assets/diagram-js.css";
    @import "~bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
    @import "~bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
    @import "~bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
    @import "~bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css";

    .containers {
        position: absolute;
        background-color: #ffffff;
        width: 100%;
        height: 100%;
    }

    .canvas {
        width: 100%;
        height: 100%;
    }

    .panel {
        position: absolute;
        right: 0;
        top: 0;
    }

    >>>.bjs-powered-by {
        display: none;
    }

    >>>.bpp-textfield input {
        box-sizing: border-box;
    }
</style>

customTranslate.js

// 引入translations.js文件
import translations from './translations';
export default function customTranslate(template, replacements) {
   replacements = replacements || {};
   // Translate
   template = translations[template] || template;
   // Replace
   return template.replace(/{([^}]+)}/g, function(_, key) {
       let str = replacements[key];
       if (translations[replacements[key]] != null && translations[replacements[key]] != 'undefined') {
           str = translations[replacements[key]];
       }
       return str || '{' + key + '}';
   });
}

translations.js 汉化

export default {
    // hong
    // Labels
    'Activate the global connect tool': '激活全局连接工具',
    'Append {type}': '追加 {type}',
    'Append EndEvent': '追加 结束事件 ',
    'Append Task': '追加 任务',
    'TextAnnotation': '追加 注释文本',
    'Append Gateway': '追加 网关',
    'Append Intermediate/Boundary Event': '追加 中间/边界 事件',
    'Add Lane above': '在上面添加道',
    'Divide into two Lanes': '分割成两个道',
    'Divide into three Lanes': '分割成三个道',
    'Add Lane below': '在下面添加道',
    'Append compensation activity': '追加补偿活动',
    'Change type': '修改类型',
    'Connect using Association': '使用关联连接',
    'Connect using Sequence/MessageFlow or Association': '使用顺序/消息流或者关联连接',
    'Connect using DataInputAssociation': '使用数据输入关联连接',
    'Remove': '移除',
    'Activate the hand tool': '激活抓手工具',
    'Activate the lasso tool': '激活套索工具',
    'Activate the create/remove space tool': '激活创建/删除空间工具',
    'Create expanded SubProcess': '创建扩展子过程',
    'Create IntermediateThrowEvent/BoundaryEvent': '创建中间抛出事件/边界事件',
    'Create Pool/Participant': '创建池/参与者',
    'Parallel Multi Instance': '并行多重事件',
    'Sequential Multi Instance': '时序多重事件',
    'DataObjectReference': '数据对象参考',
    'DataStoreReference': '数据存储参考',
    'Loop': '循环',
    'Ad-hoc': '即席',
    'Create {type}': '创建 {type}',
    'Create Task': '创建任务',
    'Create StartEvent': '创建开始事件',
    'Create EndEvent': '创建结束事件',
    'Create Group': '创建组',
    'Task': '任务',
    'Send Task': '发送任务',
    'Receive Task': '接收任务',
    'User Task': '用户任务',
    'Manual Task': '手工任务',
    'Business Rule Task': '业务规则任务',
    'Service Task': '服务任务',
    'Script Task': '脚本任务',
    'Call Activity': '调用活动',
    'Sub Process (collapsed)': '子流程(折叠的)',
    'Sub Process (expanded)': '子流程(展开的)',
    'Start Event': '开始事件',
    'StartEvent': '开始事件',
    'Intermediate Throw Event': '中间事件',
    'End Event': '结束事件',
    'EndEvent': '结束事件',
    'Create Gateway': '创建网关',
    'GateWay': '网关',
    'Create Intermediate/Boundary Event': '创建中间/边界事件',
    'Message Start Event': '消息开始事件',
    'Timer Start Event': '定时开始事件',
    'Conditional Start Event': '条件开始事件',
    'Signal Start Event': '信号开始事件',
    'Error Start Event': '错误开始事件',
    'Escalation Start Event': '升级开始事件',
    'Compensation Start Event': '补偿开始事件',
    'Message Start Event (non-interrupting)': '消息开始事件(非中断)',
    'Timer Start Event (non-interrupting)': '定时开始事件(非中断)',
    'Conditional Start Event (non-interrupting)': '条件开始事件(非中断)',
    'Signal Start Event (non-interrupting)': '信号开始事件(非中断)',
    'Escalation Start Event (non-interrupting)': '升级开始事件(非中断)',
    'Message Intermediate Catch Event': '消息中间捕获事件',
    'Message Intermediate Throw Event': '消息中间抛出事件',
    'Timer Intermediate Catch Event': '定时中间捕获事件',
    'Escalation Intermediate Throw Event': '升级中间抛出事件',
    'Conditional Intermediate Catch Event': '条件中间捕获事件',
    'Link Intermediate Catch Event': '链接中间捕获事件',
    'Link Intermediate Throw Event': '链接中间抛出事件',
    'Compensation Intermediate Throw Event': '补偿中间抛出事件',
    'Signal Intermediate Catch Event': '信号中间捕获事件',
    'Signal Intermediate Throw Event': '信号中间抛出事件',
    'Message End Event': '消息结束事件',
    'Escalation End Event': '定时结束事件',
    'Error End Event': '错误结束事件',
    'Cancel End Event': '取消结束事件',
    'Compensation End Event': '补偿结束事件',
    'Signal End Event': '信号结束事件',
    'Terminate End Event': '终止结束事件',
    'Message Boundary Event': '消息边界事件',
    'Message Boundary Event (non-interrupting)': '消息边界事件(非中断)',
    'Timer Boundary Event': '定时边界事件',
    'Timer Boundary Event (non-interrupting)': '定时边界事件(非中断)',
    'Escalation Boundary Event': '升级边界事件',
    'Escalation Boundary Event (non-interrupting)': '升级边界事件(非中断)',
    'Conditional Boundary Event': '条件边界事件',
    'Conditional Boundary Event (non-interrupting)': '条件边界事件(非中断)',
    'Error Boundary Event': '错误边界事件',
    'Cancel Boundary Event': '取消边界事件',
    'Signal Boundary Event': '信号边界事件',
    'Signal Boundary Event (non-interrupting)': '信号边界事件(非中断)',
    'Compensation Boundary Event': '补偿边界事件',
    'Exclusive Gateway': '互斥网关',
    'Parallel Gateway': '并行网关',
    'Inclusive Gateway': '相容网关',
    'Complex Gateway': '复杂网关',
    'Event based Gateway': '事件网关',
    'Transaction': '转运',
    'Sub Process': '子流程',
    'Event Sub Process': '事件子流程',
    'Collapsed Pool': '折叠池',
    'Expanded Pool': '展开池',
    // Errors
    'no parent for {element} in {parent}': '在{parent}里,{element}没有父类',
    'no shape type specified': '没有指定的形状类型',
    'flow elements must be children of pools/participants': '流元素必须是池/参与者的子类',
    'out of bounds release': 'out of bounds release',
    'more than {count} child lanes': '子道大于{count} ',
    'element required': '元素不能为空',
    'diagram not part of bpmn:Definitions': '流程图不符合bpmn规范',
    'no diagram to display': '没有可展示的流程图',
    'no process or collaboration to display': '没有可展示的流程/协作',
    'element {element} referenced by {referenced}#{property} not yet drawn': '由{referenced}#{property}引用的{element}元素仍未绘制',
    'already rendered {element}': '{element} 已被渲染',
    'failed to import {element}': '导入{element}失败',
    //属性面板的参数
    'Id': '编号',
    'Name': '名称',
    'General': '常规',
    'Details': '详情',
    'Message Name': '消息名称',
    'Message': '消息',
    'Initiator': '创建者',
    'Asynchronous Continuations': '持续异步',
    'Asynchronous Before': '异步前',
    'Asynchronous After': '异步后',
    'Job Configuration': '工作配置',
    'Exclusive': '排除',
    'Job Priority': '工作优先级',
    'Retry Time Cycle': '重试时间周期',
    'Documentation': '文档',
    'Element Documentation': '元素文档',
    'History Configuration': '历史配置',
    'History Time To Live': '历史的生存时间',
    'Forms': '表单',
    'Form Key': '表单key',
    'Form Fields': '表单字段',
    'Business Key': '业务key',
    'Form Field': '表单字段',
    'ID': '编号',
    'Type': '类型',
    'Label': '名称',
    'Default Value': '默认值',
    'Validation': '校验',
    'Add Constraint': '添加约束',
    'Config': '配置',
    'Properties': '属性',
    'Add Property': '添加属性',
    'Value': '值',
    'Add': '添加',
    'Values': '值',
    'Add Value': '添加值',
    'Listeners': '监听器',
    'Execution Listener': '执行监听',
    'Event Type': '事件类型',
    'Listener Type': '监听器类型',
    'Java Class': 'Java类',
    'Expression': '表达式',
    'Must provide a value': '必须提供一个值',
    'Delegate Expression': '代理表达式',
    'Script': '脚本',
    'Script Format': '脚本格式',
    'Script Type': '脚本类型',
    'Inline Script': '内联脚本',
    'External Script': '外部脚本',
    'Resource': '资源',
    'Field Injection': '字段注入',
    'Extensions': '扩展',
    'Input/Output': '输入/输出',
    'Input Parameters': '输入参数',
    'Output Parameters': '输出参数',
    'Parameters': '参数',
    'Output Parameter': '输出参数',
    'Timer Definition Type': '定时器定义类型',
    'Timer Definition': '定时器定义',
    'Date': '日期',
    'Duration': '持续',
    'Cycle': '循环',
    'Signal': '信号',
    'Signal Name': '信号名称',
    'Escalation': '升级',
    'Error': '错误',
    'Link Name': '链接名称',
    'Condition': '条件名称',
    'Variable Name': '变量名称',
    'Variable Event': '变量事件',
    'Specify more than one variable change event as a comma separated list.': '多个变量事件以逗号隔开',
    'Wait for Completion': '等待完成',
    'Activity Ref': '活动参考',
    'Version Tag': '版本标签',
    'Executable': '可执行文件',
    'External Task Configuration': '扩展任务配置',
    'Task Priority': '任务优先级',
    'External': '外部',
    'Connector': '连接器',
    'Must configure Connector': '必须配置连接器',
    'Connector Id': '连接器编号',
    'Implementation': '实现方式',
    'Field Injections': '字段注入',
    'Fields': '字段',
    'Result Variable': '结果变量',
    'Topic': '主题',
    'Configure Connector': '配置连接器',
    'Input Parameter': '输入参数',
    'Assignee': '代理人',
    'Candidate Users': '候选用户',
    'Candidate Groups': '候选组',
    'Due Date': '到期时间',
    'Follow Up Date': '跟踪日期',
    'Priority': '优先级',
    'The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00',
    'The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)': '跟踪日期必须符合EL表达式,如: ${someDate} ,或者一个ISO标准日期,如:2015-06-26T09:54:00',
    'Variables': '变量',
    'Candidate Starter Configuration': '候选开始配置',
    'Task Listener': '任务监听器',
    'Candidate Starter Groups': '候选开始组',
    'Candidate Starter Users': '候选开始用户',
    'Tasklist Configuration': '任务列表配置',
    'Startable': '启动',
    'Specify more than one group as a comma separated list.': '指定多个组,用逗号分隔',
    'Specify more than one user as a comma separated list.': '指定多个用户,用逗号分隔',
    'This maps to the process definition key.': '这会映射为流程定义的键',
    'CallActivity Type': '调用活动类型',
    'Condition Type': '条件类型',
    'Create UserTask': '创建用户任务',
    'Create CallActivity': '创建调用活动',
    'Called Element': '调用元素',
    'Create DataObjectReference': '创建数据对象引用',
    'Create DataStoreReference': '创建数据存储引用',
    'Multi Instance': '多实例',
    'Loop Cardinality': '实例数量',
    'Collection': '任务参与人列表',
    'Element Variable': '元素变量',
    'Completion Condition': '完成条件'
};

initXmlString.js 初始化模板

export const bpmnXmlStr = `
      <?xml version="1.0" encoding="UTF-8"?>
      <bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC">
        <bpmn2:process id="process1567044459787" name="流程1567044459787">
          <bpmn2:documentation>描述</bpmn2:documentation>
          <bpmn2:startEvent id="StartEvent_01ydzqe" name="开始">
            <bpmn2:outgoing>SequenceFlow_1qw929z</bpmn2:outgoing>
          </bpmn2:startEvent>
          <bpmn2:sequenceFlow id="SequenceFlow_1qw929z" sourceRef="StartEvent_01ydzqe" targetRef="Task_1piqdk6" />
          <bpmn2:userTask id="Task_1piqdk6" name="请假申请">
            <bpmn2:incoming>SequenceFlow_1qw929z</bpmn2:incoming>
            <bpmn2:outgoing>SequenceFlow_11h4o22</bpmn2:outgoing>
          </bpmn2:userTask>
          <bpmn2:exclusiveGateway id="ExclusiveGateway_0k39v3u">
            <bpmn2:incoming>SequenceFlow_11h4o22</bpmn2:incoming>
            <bpmn2:outgoing>SequenceFlow_1iu7pfe</bpmn2:outgoing>
            <bpmn2:outgoing>SequenceFlow_04uqww2</bpmn2:outgoing>
          </bpmn2:exclusiveGateway>
          <bpmn2:sequenceFlow id="SequenceFlow_11h4o22" sourceRef="Task_1piqdk6" targetRef="ExclusiveGateway_0k39v3u" />
          <bpmn2:sequenceFlow id="SequenceFlow_1iu7pfe" sourceRef="ExclusiveGateway_0k39v3u" targetRef="Task_10fqcwp" />
          <bpmn2:userTask id="Task_10fqcwp" name="经理审批">
            <bpmn2:incoming>SequenceFlow_1iu7pfe</bpmn2:incoming>
            <bpmn2:outgoing>SequenceFlow_1xod8nh</bpmn2:outgoing>
          </bpmn2:userTask>
          <bpmn2:sequenceFlow id="SequenceFlow_04uqww2" sourceRef="ExclusiveGateway_0k39v3u" targetRef="Task_15n23yh" />
          <bpmn2:userTask id="Task_15n23yh" name="总部审批">
            <bpmn2:incoming>SequenceFlow_04uqww2</bpmn2:incoming>
            <bpmn2:outgoing>SequenceFlow_0c8wrs4</bpmn2:outgoing>
          </bpmn2:userTask>
          <bpmn2:exclusiveGateway id="ExclusiveGateway_1sq33g6">
            <bpmn2:incoming>SequenceFlow_0c8wrs4</bpmn2:incoming>
            <bpmn2:incoming>SequenceFlow_1xod8nh</bpmn2:incoming>
            <bpmn2:outgoing>SequenceFlow_0h8za82</bpmn2:outgoing>
          </bpmn2:exclusiveGateway>
          <bpmn2:sequenceFlow id="SequenceFlow_0c8wrs4" sourceRef="Task_15n23yh" targetRef="ExclusiveGateway_1sq33g6" />
          <bpmn2:sequenceFlow id="SequenceFlow_1xod8nh" sourceRef="Task_10fqcwp" targetRef="ExclusiveGateway_1sq33g6" />
          <bpmn2:endEvent id="EndEvent_0pnmjd3">
            <bpmn2:incoming>SequenceFlow_0h8za82</bpmn2:incoming>
          </bpmn2:endEvent>
          <bpmn2:sequenceFlow id="SequenceFlow_0h8za82" sourceRef="ExclusiveGateway_1sq33g6" targetRef="EndEvent_0pnmjd3" />
        </bpmn2:process>
        <bpmndi:BPMNDiagram id="BPMNDiagram_1">
          <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="process1567044459787">
            <bpmndi:BPMNEdge id="SequenceFlow_0h8za82_di" bpmnElement="SequenceFlow_0h8za82">
              <di:waypoint x="550" y="565" />
              <di:waypoint x="550" y="602" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="SequenceFlow_1xod8nh_di" bpmnElement="SequenceFlow_1xod8nh">
              <di:waypoint x="1300" y="390" />
              <di:waypoint x="1300" y="540" />
              <di:waypoint x="575" y="540" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="SequenceFlow_0c8wrs4_di" bpmnElement="SequenceFlow_0c8wrs4">
              <di:waypoint x="430" y="460" />
              <di:waypoint x="430" y="540" />
              <di:waypoint x="525" y="540" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="SequenceFlow_04uqww2_di" bpmnElement="SequenceFlow_04uqww2">
              <di:waypoint x="525" y="300" />
              <di:waypoint x="430" y="300" />
              <di:waypoint x="430" y="380" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="SequenceFlow_1iu7pfe_di" bpmnElement="SequenceFlow_1iu7pfe">
              <di:waypoint x="556" y="319" />
              <di:waypoint x="580" y="400" />
              <di:waypoint x="830" y="120" />
              <di:waypoint x="1250" y="326" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="SequenceFlow_11h4o22_di" bpmnElement="SequenceFlow_11h4o22">
              <di:waypoint x="550" y="230" />
              <di:waypoint x="550" y="275" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="SequenceFlow_1qw929z_di" bpmnElement="SequenceFlow_1qw929z">
              <di:waypoint x="550" y="108" />
              <di:waypoint x="550" y="150" />
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNShape id="StartEvent_01ydzqe_di" bpmnElement="StartEvent_01ydzqe">
              <dc:Bounds x="532" y="72" width="36" height="36" />
              <bpmndi:BPMNLabel>
                <dc:Bounds x="539" y="53" width="22" height="14" />
              </bpmndi:BPMNLabel>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="UserTask_1qxjy46_di" bpmnElement="Task_1piqdk6">
              <dc:Bounds x="500" y="150" width="100" height="80" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="ExclusiveGateway_0k39v3u_di" bpmnElement="ExclusiveGateway_0k39v3u" isMarkerVisible="true">
              <dc:Bounds x="525" y="275" width="50" height="50" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="UserTask_1j0us24_di" bpmnElement="Task_15n23yh">
              <dc:Bounds x="380" y="380" width="100" height="80" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="ExclusiveGateway_1sq33g6_di" bpmnElement="ExclusiveGateway_1sq33g6" isMarkerVisible="true">
              <dc:Bounds x="525" y="515" width="50" height="50" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="EndEvent_0pnmjd3_di" bpmnElement="EndEvent_0pnmjd3">
              <dc:Bounds x="532" y="602" width="36" height="36" />
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="UserTask_18pwui1_di" bpmnElement="Task_10fqcwp">
              <dc:Bounds x="1250" y="310" width="100" height="80" />
            </bpmndi:BPMNShape>
          </bpmndi:BPMNPlane>
        </bpmndi:BPMNDiagram>
      </bpmn2:definitions>
    
      `;

相关文章

  • flowable 流程图的 Vue 库

    workflow-bpmn-modeler workflow-bpmn-modeler 基于 Vue 和 bpmn...

  • BPMN的学习记录

    1.vue需要引入BPMN的包 npm install bpmn-js bpmn-js-properties-p...

  • vue引用bpmn.js实现svg和bpmn格式保存下载

    vue引用bpmn.js实现流程图的渲染编辑,以及以svg和bpmn格式保存下载。效果图 前提需安装bpmn.js...

  • vue引用bpmn.js封装使用

    封装bpmn.js,页面直接传参调用即可实现流程图渲染,避免每个页面都需初始化一遍bpmn的引入。前提需安装bpm...

  • 在vue中使用bpmn-js(二)

    2.新建空的图,功能要求: ① 空的,能自己画;② 以SVG image格式、BPMN diagram格式下载在本...

  • 在vue中使用bpmn-js(一)

    由于之前的公司的项目中的工作流管理要用到流程图,而bpmn-js官方的文档是全英的而且使用的js框架是jQuery...

  • 在vue中使用bpmn-js(三)

    3.关于节点的配置,功能要求:①在服务器取到图并显示出来②不能编辑和改动图③可以获取到具体某个节点的信息 参考链接...

  • 在vue中使用bpmn-js(四)

    给节点和线上色,其实就是找到这个节点的id,然后改变它的样式。这里是写死的某几个节点和线,真正应该通过与后台交互获...

  • 在vue中使用bpmn-js(进阶)

    由于公司前段时间在打造一个开发平台,而我主要负责工作流模块,于是就接触到了bpmn-js。但众所周知,bpmn-j...

  • VUE--工作流--bpmn.js(一)

    一、bpmn.js 简介   一个BPMN 2.0渲染工具包和Web建模器。使用JavaScript编写,在不需要...

网友评论

      本文标题:vue BPMN 使用

      本文链接:https://www.haomeiwen.com/subject/wudogdtx.html