Giter Site home page Giter Site logo

leesings / camunda-bpmn-converter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lzgabel/camunda-bpmn-converter

0.0 0.0 0.0 1.65 MB

Convert JSON to BPMN for camunda.

Home Page: http://lzgabel.cn

JavaScript 6.46% Java 50.15% CSS 13.74% HTML 0.20% Vue 29.45%

camunda-bpmn-converter's Introduction

Camunda BPMN Converter

Convert json to bpmn for Camunda Platform.

1. 节点类型(nodeType)

  • serviceTask
    • service 任务节点
  • userTask
    • userTask 任务节点
  • parallelGateway
    • 并行节点
  • exclusiveGateway
    • 排他节点

2. 数据结构

  • serviceTask
{
    "nodeName":"审核人1",
    "nodeType":"serviceTask",
    "nextNode": null
}
  • userTask
{
    "nodeName":"审核人1",
    "nodeType":"userTask",
    "assignee": "aaa",
    "candidateUsers": "bbb,ccc",
    "candidateGroups": "bbb,ddd",
    "nextNode": null
}

对于 parallelGateway/exclusiveGateway 类型,目前建议设置 nextNode 的 nodeType 类型一一对应

  • exclusive
{
    "nodeName":"排他",
    "nodeType":"exclusiveGateway",
    "nextNode":{
        "nodeName":"",
        "nodeType":"exclusiveGateway",
        "nextNode":null
    },
    "branchNodes":[
        {
            "nodeName":"条件1",
            "conditionExpression":"=id>1",
            "nextNode":{
                "nodeName":"审核人2.1",
                "nodeType":"serviceTask",
                "nextNode": null
            }
        },
        {
            "nodeName":"条件2",
            "conditionExpression":"=id<1",
            "nextNode":{
                "nodeName":"审核人2.2",
                "nodeType":"serviceTask",
                "nextNode":null
            }
        },
        {...}
    ]
}
  • parallel
{
    "nodeName":"并行任务",
    "nodeType":"parallelGateway",
    "nextNode":{
        "nodeName":"",
        "nodeType":"parallelGateway",
        "nextNode":null
    },
    "branchNodes":[
        {
            "nextNode":{
                "nodeName":"审核人2.1",
                "nodeType":"serviceTask",
                "nextNode": null
            }
        },
        {
            "nextNode":{
                "nodeName":"审核人2.2",
                "nodeType":"serviceTask",
                "nextNode":null
            }
        },
        {
            "nextNode":{
                "nodeName":"审核人2.3",
                "nodeType":"serviceTask",
                "nextNode":null
            }
        },
        {...}
    ]
}
  • 完整数据结构
{
    "process":{
        "processId":"work-flow-id",
        "name":"合同审批"
    },
    "processNode":{
        "nodeName":"审核人1",
        "nodeType":"serviceTask",
        "taskHeaders":{
            "a":"b",
            "e":"d"
        },
        "nextNode":{
            "nodeName":"排他",
            "nodeType":"exclusiveGateway",
            "nextNode":{
                "nodeName":"排他网关",
                "nodeType":"exclusiveGateway",
                "nextNode":null
            },
            "branchNodes":[
                {
                    "nodeName":"条件1",
                    "conditionExpression":"=id>1",
                    "nextNode":{
                        "nodeName":"审核人2.1",
                        "nodeType":"userTask",
                        "assignee": "aaa",
                        "candidateGroups": "bbb",
                        "nextNode":null
                    }
                },
                {
                    "nodeName":"条件2",
                    "conditionExpression":"=id<1",
                    "nextNode":{
                        "nodeName":"审核人2.2",
                        "nodeType":"serviceTask",
                        "nextNode":null
                    }
                }
            ]
        }
    }
}

3. 示例

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.