All Projects → evanyangg → Vue Bpmn Modeler

evanyangg / Vue Bpmn Modeler

Licence: mit
Design BPMN 2.0 modeler in a Vue.js application based on bpmn-js.

Projects that are alternatives of or similar to Vue Bpmn Modeler

React Idle Timer
User activity timer component
Stars: ✭ 420 (+371.91%)
Mutual labels:  activity
Activityswitcher
ActivitySwitcher is based on the Activity view operation management library, you can achieve any jump between Activity, close any Activity and end applications and other functions.
Stars: ✭ 1,030 (+1057.3%)
Mutual labels:  activity
Mkringprogressview
⭕️ Ring progress view similar to Activity app on Apple Watch
Stars: ✭ 1,140 (+1180.9%)
Mutual labels:  activity
Devutils
🔥 ( 持续更新,目前含 160+ 工具类 ) DevUtils 是一个 Android 工具库,主要根据不同功能模块,封装快捷使用的工具类及 API 方法调用。该项目尽可能的便于开发人员,快捷、高效开发安全可靠的项目。
Stars: ✭ 680 (+664.04%)
Mutual labels:  activity
Activity
A PHP API to log anything anywhere
Stars: ✭ 44 (-50.56%)
Mutual labels:  activity
Android Toy
不积跬步 无以至千里
Stars: ✭ 54 (-39.33%)
Mutual labels:  activity
Keepalive
Fighting against force-stop kill process on Android with binder ioctl / Android高级保活
Stars: ✭ 376 (+322.47%)
Mutual labels:  activity
Rxbus
Android reactive event bus that simplifies communication between Presenters, Activities, Fragments, Threads, Services, etc.
Stars: ✭ 79 (-11.24%)
Mutual labels:  activity
Viewtooltip
A fluent tooltip for Android
Stars: ✭ 1,029 (+1056.18%)
Mutual labels:  activity
Androidpreferenceactivity
Provides an alternative implementation of Android's PreferenceActivity
Stars: ✭ 63 (-29.21%)
Mutual labels:  activity
Android Dragdismissactivity
A smooth, easy-to-implement, drag to dismiss Android Activity.
Stars: ✭ 682 (+666.29%)
Mutual labels:  activity
Blog Post Workflow
Show your latest blog posts from any sources or StackOverflow activity or Youtube Videos on your GitHub profile/project readme automatically using the RSS feed
Stars: ✭ 910 (+922.47%)
Mutual labels:  activity
Mlkatas
A series of self-correcting challenges for practicing your Machine Learning and Deep Learning skills
Stars: ✭ 58 (-34.83%)
Mutual labels:  activity
Laravel Acquaintances
This package gives Eloquent models the ability to manage friendships (with groups), followships along with Likes, favorites..etc .
Stars: ✭ 449 (+404.49%)
Mutual labels:  activity
Discordipc
Connect locally to the Discord client using IPC for a subset of RPC features like Rich Presence and Activity Join/Spectate
Stars: ✭ 66 (-25.84%)
Mutual labels:  activity
Activitystarter
Simple Android Library, that provides easy way to start the Activities with arguments.
Stars: ✭ 414 (+365.17%)
Mutual labels:  activity
Thirtyinch
a MVP library for Android favoring a stateful Presenter
Stars: ✭ 1,052 (+1082.02%)
Mutual labels:  activity
Pg activity
pg_activity is a top like application for PostgreSQL server activity monitoring.
Stars: ✭ 1,232 (+1284.27%)
Mutual labels:  activity
Activity
⚡️ Activity app for Nextcloud
Stars: ✭ 67 (-24.72%)
Mutual labels:  activity
Starhub
All about your Github account, public and private activity, watch stars, followers and much more.
Stars: ✭ 60 (-32.58%)
Mutual labels:  activity

vue-bpmn-modeler

Design BPMN 2.0 modeler in a Vue.js application based on bpmn-js.

Usage

yarn add vue-bpmn-modeler
# main.js
import VueBpmnModeler from "vue-bpmn-modeler";
Vue.use(VueBpmnModeler);
# yourPage.vue
<style lang="less">
@import "~vue-bpmn-modeler/lib/vue-bpmn-modeler.css";
</style>

viewer

组件会显示设计器,参数 v-model="modeler",会通过画图操作实时返回对应的xml数据和svg数据,用于保存初始化的模板。

<template>
  <BpmnModeler v-model="modeler"></BpmnModeler>
</template>

<script>
  export default {
    name: "BpmnModeler",
    props: {
      diagramXML: String
    },
    watch: {
      diagramXML(val) {
        this.openDiagram(val)
      }
    },
    data() {
      modeler: {
        // 模型xml数据
        // model xml data
        xmlData: "",
        // svg图片数据
        // svg data
        svgImage: ""
      }
    },
    // 详细代码请参考源码
    // see source code for detail
    mounted() {
    },
    methods: {

      openDiagram(xml) {
        if (xml) {
          this.modeler.importXML(xml, function(err) {
            if (err) {
              console.error(err);
            } else {
            }
          });
          this.xmlData = xml;
        } else {
          this.modeler.createDiagram();
          let _self = this;
          setTimeout(() => {
            /**
             * 修改xml属性值 isExecutable = false => true
             * isExecutable = false 后端部署流程时 不会创建流程定义数据
             */
            let modelerCanvas = _self.modeler.get("canvas");
            let rootElement = modelerCanvas.getRootElement();
            let modeling = _self.modeler.get("modeling");
            // modeling.updateProperties(rootElement, {
            //   // isExecutable: true
            // });
            // 设定开始节点名称和结束节点名称
            // set StartEvent name 'start' and EndEvent name 'end'
            rootElement.children.forEach(n => {
              if (n.type === 'bpmn:StartEvent') {
                modeling.updateProperties(n, {
                  name: '开始',
                });
              } else if (n.type === 'bpmn:EndEvent') {
                modeling.updateProperties(n, {
                  name: '结束',
                });
              }
            })
          });
        }
      }
    }
  };
</script>

当流程启动时,流程会默认走到第一个节点 提交申请,此时的待办任务会显示橙色。

When the process starts, the process will complete first task by default, and the TODO tasks will be orange.

viewer

当流程完成 提交申请 且满足 条件1 时,流程会走到 成本中心 节点,此时已经完成的待办任务会显示绿色。

when the first task completed and met condition 1, the process coming to 'costcenter' task, Completed tasks displayed in green.

viewer

参数介绍: xmlData: 表示流程图的xml数据 taskList: 表示流程的历史记录 可以通过服务的接口 historyService 获得

<template>
  <BpmnViewer :xmlData="xmlData" :taskData="taskList"></BpmnViewer>
</template>

<script>
  export default {
    data() {
      modeler: {
        // 模型xml数据
        xmlData: "",
        // 任务列表
        taskList: [{
          // 任务定义的key
          "key": "",
          // 任务是否完成
          "completed": true
        }]
      }
    }
  };
</script>

动态添加/替换任务节点

dynamically add/replace task

viewer

addTask () {
  let addOrReplace = {
    // task || sequenceFlow || gateway
    replaceActivity: 'UserTask_0hkfnx2',
    taskList: [
      {
        label: 'test task'
      }
    ]
  }
  this.$refs.modeler.replace(addOrReplace).then((taskList) => {
    // new task list, incluce taskId
    console.log(taskList);
  });
}

开启 propertiesPanel

<template>
  <BpmnModeler v-model="modeler" propertiesPanel></BpmnModeler>
</template>

Examples

# clone the project
git clone https://github.com/evanyangg/vue-bpmn-modeler.git

# enter the project directory
cd vue-bpmn-modeler

# install dependencies
yarn

# serve with hot reload at localhost:8080
yarn serve

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].