Giter Site home page Giter Site logo

goldsubmarine / workflow-bpmn-modeler Goto Github PK

View Code? Open in Web Editor NEW
1.2K 35.0 333.0 2.63 MB

🔥 flowable workflow designer based on vue and [email protected]

Home Page: https://goldsubmarine.github.io/workflow-bpmn-modeler/demo/

License: MIT License

JavaScript 28.91% Vue 70.53% HTML 0.56%
bpmn vue flowable

workflow-bpmn-modeler's Introduction

English | 简体中文

workflow-bpmn-modeler

NPM Version NPM Downloads

🔥 This project implements flowable's workflow designer based on vue and [email protected]

Preview 📟

20200930030243

Online demo 📢

👉 https://goldsubmarine.github.io/workflow-bpmn-modeler/demo/

Install ⏳

# Install
yarn add workflow-bpmn-modeler

How to use 👣

<template>
  <div>
    <bpmn-modeler
      ref="refNode"
      :xml="xml"
      :users="users"
      :groups="groups"
      :categorys="categorys"
      :is-view="false"
      @save="save"
    />
  </div>
</template>

<script>
import bpmnModeler from "workflow-bpmn-modeler";

export default {
  components: {
    bpmnModeler,
  },
  data() {
    return {
      xml: "", // Query the xml
      users: [
        { name: "The Beatles", id: "1" },
        { name: "The Rolling Stones", id: "2" },
        { name: "Pink Floyed", id: "3" },
      ],
      groups: [
        { name: "Folk Music", id: "4" },
        { name: "Rock Music", id: "5" },
        { name: "Classical Music", id: "6" },
      ],
      categorys: [
        { name: "Music", id: "7" },
        { name: "Articles", id: "8" },
      ],
    };
  },
  methods: {
    getModelDetail() {
      // Send request to get xml
      // this.xml = response.xml
    },
    save(data) {
      console.log(data);  // { process: {...}, xml: '...', svg: '...' }
    },
  },
};
</script>

Iframe Deployment 🎪

If your project is a jquery or react project, you can integrate the workflow designer by means of an iframe

This repository deployed a static page by the github pages, using jsdelivr cdn, access in China is also very fast, so you can directly integrate the pages of this repository, because all the free github resources are used, did not build their own server maintenance, so do not worry about the failure of resources.

Of course you can also download the corresponding version from the docs/lib folder for local deployment.

The integration method is as follows (ps: you can copy the following code directly into an html file and try it out)

<!DOCTYPE html>
<html lang="en">
  <body>
    <iframe
      src="https://goldsubmarine.github.io/workflow-bpmn-modeler/cdn/0.2.8/"
      id="myFrame"
      frameborder="0"
      width="100%"
      height="800px">
    </iframe>

    <script>
      let myFrame = document.getElementById("myFrame");
      // Get details
      window.addEventListener("message", (event) => {
        console.log(event.data); // { xml: 'xxx', img: 'xxx', process: {} }
      });
      myFrame.onload = () => {
        let postMsg = {
          xml: "", // Query the xml
          users: [
            { name: "The Beatles", id: "1" },
            { name: "The Rolling Stones", id: "2" },
            { name: "Pink Floyed", id: "3" },
          ],
          groups: [
            { name: "Folk Music", id: "4" },
            { name: "Rock Music", id: "5" },
            { name: "Classical Music", id: "6" },
          ],
          categorys: [
            { name: "Music", id: "7" },
            { name: "Articles", id: "8" },
          ],
          isView: false
        }
        // Set initialization value
        myFrame.contentWindow.postMessage(postMsg, "*")
      }
    </script>
  </body>
</html>

Customization 🛠

This component is aligned to the official flowable designer, which is the standard for implementing flowable's xml rules, and the terms used in it are all terminology from the official documentation. So this component is just a tool for programmers to model and export xml by themselves during the development phase, and it is wrong to try to customize the behavior of this modeler. Your own business should be developed separately to implement it.

The component will not upgrade the UI library or vue in the future, and regardless of library compatibility, integrating the modeler via an iframe is the easiest and correct way to do it.

Sponsor 🧡

wechat alipay
  • @bufegar ¥100
  • anonymous ¥20

License 📄

MIT

Copyright (c) 2020-present, charles

workflow-bpmn-modeler's People

Contributors

goldsubmarine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workflow-bpmn-modeler's Issues

多实例问题

现在多实例设置的属性,除了完成条件,其他属性在xml文件中看不到了,例如集合,元素变量,执行方式

vue3考虑下呗

考虑下升级库版本呗
bpmn js 已经 v8.7 了
vite 开发比较轻量化

Few questions

  1. Why u dit migrate to bpmn.io ?
  2. What engine do use on backend ?
  3. The is normal that u use bpmn.io trademark, this is doesn confuse u ?

CDATA中的小于号无法被解析

bpmn文件有条件表达式不能识别 导入文件含有" 500}]]>"出现
index.vue?6ced:159 unparsable content <=500}]]> detected; this may indicate an invalid BPMN 2.0 diagram file
line: 44
column: 78
nested error: illegal first char nodeName Array(6)
_callee$ @ index.vue?6ced:159

多实例节点保存错误

含有多实例节点保存后,在修改里面的多实例的元素变量或集合在保存就多出现一个 flowable:elementVariable="" 属性

多实例问题

画多实例节点,并行或串行的标识没有出现,导入其他文件带有多实例节点的,出现一些属性不能回显,下面提供xml文件类容

组件 :xml 无法刷新

image
image
image

父组件 传入一个有值的xml更新后 再次传入一个空的xml 去新增模型 可是还是显示之前的那个旧的 无法更新 xml

task节点支持多实例

<userTask id="UserTask1" name="U1" flowable:assignee="${assignee}">
    <multiInstanceLoopCharacteristics isSequential="false" flowable:collection="assigneeList" flowable:elementVariable="assignee">
        <completionCondition>${nrOfCompletedInstances/nrOfInstances >= 0.50}</completionCondition>
    </multiInstanceLoopCharacteristics>
</userTask>

image

image

在vue中使用的问题

在vue中使用v-show动态隐藏modeler,在v-show控制显示时会出现画布不可用的问题,拖动会造成如下图的问题,如何解决这个问题?v-show是动态给标签增加style="display: none;"来控制组件显示隐藏的

image

节点设置颜色之后 deploy 流程提示color属性不支持

节点设置颜色之后 deploy 流程提示color属性不支持。
报错信息如下:
org.flowable.bpmn.exceptions.XMLException: javax.xml.stream.XMLStreamException: org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 8; cvc-complex-type.3.2.2: Attribute 'color' is not allowed to appear in element 'startEvent'.

关于组件的部分bug

作者您好:
我最近在使用您的组件的时候发现了一些问题,现在描述给您,期待您尽快修复.
问题1:save()方法在返回的data中是通过getElement的第0个节点来返回流程id的,然而事实上第一个节点不一定是bpmn:process类型(起码我这个从其他地方生成的不是)所以建议获取的时候使用遍历查找bpmn:process 来返回数据。
问题2:扩展流程使用后,流程侧栏空白无法展示。(点击空白处也存在问题,看不到属性栏)。
期待您的回复及bug修复

信号定义报错报错

信号定义报错报错,源代码里面似乎没有写保存操作。另外signal标签可以和process标签在同一级吗?
生成的signal标签在xml中应该是有多个,但是在源代码里面也没看到循环赋值操作?

是否考虑使用原生的 elementui 封装右边的属性面板

作者您好,首先谢谢您的 workflow-bpmn-modeler ,对我帮助很大,但是我想请问下是否会考虑出另外一个版本使用原生的 elementui 封装右边的属性面板,
因为我自己原前端项目用的是原生的 elementui,如果集成您现有的 workflow-bpmn-modeler ,使用的是 xcrud ,后续维护的话要遵循 xcrud 的规范,所以我想问下,是否可以出一版使用原生 elementui 封装右边的属性面板,可能受众面也会更广一些,感谢您的耐心阅读,谢谢。

多实例`isSequential="false"`

多实例选择 串行 会显示isSequential="true" 但是 选择 并行应该 显示 isSequential="false", 但是 isSequential 没了 ,能把 isSequential="false" 时 也显示吗

vue3+vite兼容该组件时报错

作者你好,请问该组件是否支持vue3+vite?我现在使用vue3+vite的项目集成你的流程组件时提示一个element-plus的scrollbar的错误,可是我翻了挺长源码,并没有找到对应的错误位置,所以想请问下解决办法。期待你的回复,谢谢

自定义节点属性,属性无法回显

自己在侧边栏新增了一个input,输入值后,点击其它节点后再回来查看当前节点。之前设置的值为空了。请问有自定义属性的教程吗?这里应该是会进行保存,但就是不知道怎么操作。。(非专业前端开发)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.