为了账号安全,请及时绑定邮箱和手机立即绑定

Activiti6.0零编程部署工作流-资源篇(三)

标签:
Java JavaScript

导出流程文件

上一篇Activiti6.0零编程部署工作流(二)给大家介绍了如何发起工作流,通过两个角色用户演示流程的审批,其实我们也可以把设计好的流程图从系统导出来,我们通过Activiti流程引擎可以直接导出流程定义文件(second_approve.bpmn20.xml),也可以把定义的流程导出为一个压缩包,这个压缩包包含流程定义文件信息和自定义表单信息

导出流程定义文件second_approve.bpmn20.xml

管理员账号登录成功 【Kickstart App】->【Processes】->【二级审批流程】->【下载】

<?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:activiti="http://activiti.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.activiti.org/test">
  <process id="second_approve" name="二级审批流程" isExecutable="true">
    <startEvent id="startEvent" name="开始"></startEvent>
    <userTask id="submitForm" name="填写审批信息" activiti:assignee="$INITIATOR" activiti:formKey="approve_request_info">
      <extensionElements>
        <activiti:formProperty id="message" name="申请信息" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="name" name="申请人姓名" type="string" required="true"></activiti:formProperty>
        <activiti:formProperty id="submitTime" name="提交时间" type="date" datePattern="yyyy-MM-dd" required="true"></activiti:formProperty>
        <activiti:formProperty id="submitType" name="确认申请" type="string" required="true"></activiti:formProperty>
        <modeler:activiti-idm-initiator xmlns:modeler="http://activiti.com/modeler"><![CDATA[true]]></modeler:activiti-idm-initiator>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow1" sourceRef="startEvent" targetRef="submitForm"></sequenceFlow>
    <exclusiveGateway id="decideSubmit" name="提交OR取消"></exclusiveGateway>
    <sequenceFlow id="flow2" sourceRef="submitForm" targetRef="decideSubmit"></sequenceFlow>
    <userTask id="tl_approve" name="主管审批" activiti:candidateUsers="usertl" activiti:formKey="approve_approve_result">
      <extensionElements>
        <activiti:formProperty id="tlApprove" name="主管审批结果" type="string"></activiti:formProperty>
        <activiti:formProperty id="tlMessage" name="主管备注" type="string" required="true"></activiti:formProperty>
        <modeler:user-info-email-usertl xmlns:modeler="http://activiti.com/modeler"><![CDATA[usertl@126.com]]></modeler:user-info-email-usertl>
        <modeler:user-info-firstname-usertl xmlns:modeler="http://activiti.com/modeler"><![CDATA[user]]></modeler:user-info-firstname-usertl>
        <modeler:user-info-lastname-usertl xmlns:modeler="http://activiti.com/modeler"><![CDATA[tl]]></modeler:user-info-lastname-usertl>
        <modeler:activiti-idm-candidate-user xmlns:modeler="http://activiti.com/modeler"><![CDATA[true]]></modeler:activiti-idm-candidate-user>
        <modeler:initiator-can-complete xmlns:modeler="http://activiti.com/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
      </extensionElements>
    </userTask>
    <sequenceFlow id="flow3" sourceRef="decideSubmit" targetRef="tl_approve">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${submitType == "y" || submitType == "Y"}]]></conditionExpression>
    </sequenceFlow>
    <exclusiveGateway id="decideTLApprove" name="主管审批校验"></exclusiveGateway>
    <sequenceFlow id="flow4" sourceRef="tl_approve" targetRef="decideTLApprove"></sequenceFlow>
    <endEvent id="endEvent" name="结束"></endEvent>
    <endEvent id="endEventCancel" name="取消"></endEvent>
    <sequenceFlow id="flow9" sourceRef="decideTLApprove" targetRef="submitForm">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${tlApprove == "n" || tlApprove == "N"}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_2" sourceRef="decideTLApprove" targetRef="endEvent">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${tlApprove == "y" || tlApprove == "Y"}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow8" sourceRef="decideSubmit" targetRef="endEventCancel">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${submitType == "n" || submitType == "N"}]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_second_approve">
    <bpmndi:BPMNPlane bpmnElement="second_approve" id="BPMNPlane_second_approve">
      <bpmndi:BPMNShape bpmnElement="startEvent" id="BPMNShape_startEvent">
        <omgdc:Bounds height="30.0" width="30.0" x="160.0" y="180.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="submitForm" id="BPMNShape_submitForm">
        <omgdc:Bounds height="55.0" width="105.0" x="240.0" y="171.5"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="decideSubmit" id="BPMNShape_decideSubmit">
        <omgdc:Bounds height="40.0" width="40.0" x="390.0" y="178.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="tl_approve" id="BPMNShape_tl_approve">
        <omgdc:Bounds height="55.0" width="105.0" x="465.0" y="165.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="decideTLApprove" id="BPMNShape_decideTLApprove">
        <omgdc:Bounds height="40.0" width="40.0" x="625.0" y="179.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endEvent" id="BPMNShape_endEvent">
        <omgdc:Bounds height="28.0" width="28.0" x="720.0" y="183.5"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endEventCancel" id="BPMNShape_endEventCancel">
        <omgdc:Bounds height="28.0" width="28.0" x="510.0" y="250.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="189.9913158315953" y="195.5103426666075"></omgdi:waypoint>
        <omgdi:waypoint x="240.0" y="197.2127659574468"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2" id="BPMNEdge__2">
        <omgdi:waypoint x="664.6685082872929" y="198.6685082872928"></omgdi:waypoint>
        <omgdi:waypoint x="720.001987961797" y="197.73592155120568"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="345.0" y="198.5531914893617"></omgdi:waypoint>
        <omgdi:waypoint x="390.168776371308" y="198.168776371308"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="429.0265486725664" y="197.02654867256638"></omgdi:waypoint>
        <omgdi:waypoint x="465.0" y="195.18604651162792"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="570.0" y="192.5"></omgdi:waypoint>
        <omgdi:waypoint x="597.5" y="192.5"></omgdi:waypoint>
        <omgdi:waypoint x="597.5" y="199.0"></omgdi:waypoint>
        <omgdi:waypoint x="625.0" y="199.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="410.0" y="218.0"></omgdi:waypoint>
        <omgdi:waypoint x="410.0" y="266.0"></omgdi:waypoint>
        <omgdi:waypoint x="510.00215401185983" y="264.24557624540597"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="645.0" y="179.0"></omgdi:waypoint>
        <omgdi:waypoint x="645.0" y="105.0"></omgdi:waypoint>
        <omgdi:waypoint x="292.5" y="105.0"></omgdi:waypoint>
        <omgdi:waypoint x="292.5" y="171.5"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

导出流程定义文件压缩包Eshopping.zip

管理员账号登录成功 【Kickstart App】->【Apps】->【二级审批流程】->【下载】

Eshopping

在这里可以看到 其实 shop_buy.json和second_approve.bpmn20.xml都描述了流程定义信息,shopping_booking_form.json描述了表单信息,对应的*.png对应模块的缩略图,我们这里简单列出两个json的内容大家参考
bpmn-models/shop_buy.json

{
  "id": "33495734-ef00-426c-8c10-2db97443c37f",
  "name": "shop_buy",
  "key": "shop_buy",
  "description": "电商平台购买流程",
  "editorJson": {
    "resourceId": "33495734-ef00-426c-8c10-2db97443c37f",
    "properties": {
      "process_id": "shop_buy",
      "name": "shop_buy",
      "documentation": "电商平台购买流程",
      "process_author": "",
      "process_version": "",
      "process_namespace": "http://www.activiti.org/processdef",
      "executionlisteners": "",
      "eventlisteners": "",
      "signaldefinitions": "",
      "messagedefinitions": ""
    },
    "stencil": {
      "id": "BPMNDiagram"
    },
    "childShapes": [
      {
        "resourceId": "sid-2C4F91BA-8B3F-4DD5-86A9-221CF5D38182",
        "properties": {
          "overrideid": "",
          "name": "电商购物流程",
          "documentation": "",
          "process_id": "process"
        },
        "stencil": {
          "id": "Pool"
        },
        "childShapes": [
          {
            "resourceId": "sid-5EB43441-97AB-4241-AE3D-88F035B028AD",
            "properties": {
              "overrideid": "",
              "name": "仓储物流",
              "documentation": "",
              "showcaption": true
            },
            "stencil": {
              "id": "Lane"
            },
            "childShapes": [
              {
                "resourceId": "sid-B823EABC-63CA-462F-998D-F700B31C751F",
                "properties": {
                  "overrideid": "userTaskSend",
                  "name": "分拣发货",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "executionlisteners": "",
                  "multiinstance_type": "None",
                  "multiinstance_cardinality": "",
                  "multiinstance_collection": "",
                  "multiinstance_variable": "",
                  "multiinstance_condition": "",
                  "isforcompensation": "false",
                  "usertaskassignment": {
                    "assignment": {
                      "type": "idm",
                      "idm": {
                        "type": "users",
                        "candidateUsers": [
                          {
                            "id": "expressA",
                            "firstName": "express",
                            "lastName": "A",
                            "email": "expressA@126.com",
                            "fullName": "express A",
                            "groups": [],
                            "$$hashKey": "object:1259"
                          },
                          {
                            "id": "expressB",
                            "firstName": "express",
                            "lastName": "B",
                            "email": "expressB@126.com",
                            "fullName": "express B",
                            "groups": [],
                            "$$hashKey": "object:1260"
                          }
                        ]
                      }
                    }
                  },
                  "formkeydefinition": "",
                  "formreference": {
                    "id": "6ad744b7-beaf-4aa7-bc7c-f2d056916bf2",
                    "name": "分拣发货",
                    "key": "shopping_send_form"
                  },
                  "duedatedefinition": "",
                  "prioritydefinition": "",
                  "formproperties": {
                    "formProperties": [
                      {
                        "id": "sendStatus",
                        "name": "发货状态",
                        "type": "boolean",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-0DD"
                      }
                    ]
                  },
                  "tasklisteners": ""
                },
                "stencil": {
                  "id": "UserTask"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-2033F964-1F9C-43FC-8689-089F34C76A3B"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 531,
                    "y": 128
                  },
                  "upperLeft": {
                    "x": 431,
                    "y": 48
                  }
                },
                "dockers": []
              }
            ],
            "outgoing": [],
            "bounds": {
              "lowerRight": {
                "x": 808,
                "y": 174.54068241469815
              },
              "upperLeft": {
                "x": 30,
                "y": 0
              }
            },
            "dockers": []
          },
          {
            "resourceId": "sid-E34052A9-32F7-4EAD-824F-8CA913A6FD44",
            "properties": {
              "overrideid": "",
              "name": "用户",
              "documentation": "",
              "showcaption": true
            },
            "stencil": {
              "id": "Lane"
            },
            "childShapes": [
              {
                "resourceId": "sid-8F0073A1-7710-4A75-9F25-F5BF61D2C5CB",
                "properties": {
                  "overrideid": "start",
                  "name": "开始购物",
                  "documentation": "",
                  "executionlisteners": "",
                  "initiator": "",
                  "formkeydefinition": "",
                  "formreference": null,
                  "formproperties": null
                },
                "stencil": {
                  "id": "StartNoneEvent"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-9C6EABB6-A184-46D2-9751-7CD7363E22E7"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 101,
                    "y": 84.45931758530185
                  },
                  "upperLeft": {
                    "x": 71,
                    "y": 54.45931758530185
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-371F6123-FE90-4750-AC5C-475F62C7FB04",
                "properties": {
                  "overrideid": "userTaskBooking",
                  "name": "下单",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "executionlisteners": "",
                  "multiinstance_type": "None",
                  "multiinstance_cardinality": "",
                  "multiinstance_collection": "",
                  "multiinstance_variable": "",
                  "multiinstance_condition": "",
                  "isforcompensation": "false",
                  "usertaskassignment": {
                    "assignment": {
                      "type": "idm",
                      "initiatorCanCompleteTask": true,
                      "idm": {
                        "type": "initiator"
                      }
                    }
                  },
                  "formkeydefinition": "",
                  "formreference": {
                    "id": "8360617e-9a88-497a-91f0-b9d467a862f3",
                    "name": "下单表单",
                    "key": "shopping_booking_form"
                  },
                  "duedatedefinition": "",
                  "prioritydefinition": "",
                  "formproperties": {
                    "formProperties": [
                      {
                        "id": "productName",
                        "name": "商品名称",
                        "type": "string",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-05U"
                      },
                      {
                        "id": "productCount",
                        "name": "商品数量",
                        "type": "long",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-062"
                      },
                      {
                        "id": "productAmount",
                        "name": "商品金额",
                        "type": "long",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-06A"
                      },
                      {
                        "id": "contactName",
                        "name": "联系人名称",
                        "type": "string",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-05K"
                      },
                      {
                        "id": "contactPhone",
                        "name": "联系电话",
                        "type": "string",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-073"
                      }
                    ]
                  },
                  "tasklisteners": ""
                },
                "stencil": {
                  "id": "UserTask"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-C2006C15-367F-47DB-83B3-0FF306D3592C"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 246,
                    "y": 109.45931758530185
                  },
                  "upperLeft": {
                    "x": 146,
                    "y": 29.459317585301847
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-52961534-9BDC-4CEF-BB25-85B0F4FAF04B",
                "properties": {
                  "overrideid": "userTaskPay",
                  "name": "支付",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "executionlisteners": "",
                  "multiinstance_type": "None",
                  "multiinstance_cardinality": "",
                  "multiinstance_collection": "",
                  "multiinstance_variable": "",
                  "multiinstance_condition": "",
                  "isforcompensation": "false",
                  "usertaskassignment": {
                    "assignment": {
                      "type": "idm",
                      "initiatorCanCompleteTask": true,
                      "idm": {
                        "type": "initiator"
                      }
                    }
                  },
                  "formkeydefinition": "",
                  "formreference": {
                    "id": "2a48f9c9-603a-44a8-9f4b-0b5933d5e82c",
                    "name": "支付表单",
                    "key": "shopping_pay_form"
                  },
                  "duedatedefinition": "",
                  "prioritydefinition": "",
                  "formproperties": {
                    "formProperties": [
                      {
                        "id": "payAmount",
                        "name": "支付金额",
                        "type": "long",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-03M"
                      },
                      {
                        "id": "payNote",
                        "name": "支付备注",
                        "type": "string",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-03U"
                      }
                    ]
                  },
                  "tasklisteners": ""
                },
                "stencil": {
                  "id": "UserTask"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-43EEC3C2-9765-4589-A7CF-9B8B621A7E26"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 361,
                    "y": 116.72965879265092
                  },
                  "upperLeft": {
                    "x": 261,
                    "y": 36.72965879265092
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-1F948474-0744-4D1D-B9D0-F5545EFFABF1",
                "properties": {
                  "overrideid": "userTaskSign",
                  "name": "签收",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "executionlisteners": "",
                  "multiinstance_type": "None",
                  "multiinstance_cardinality": "",
                  "multiinstance_collection": "",
                  "multiinstance_variable": "",
                  "multiinstance_condition": "",
                  "isforcompensation": "false",
                  "usertaskassignment": {
                    "assignment": {
                      "type": "idm",
                      "initiatorCanCompleteTask": true,
                      "idm": {
                        "type": "initiator"
                      }
                    }
                  },
                  "formkeydefinition": "",
                  "formreference": {
                    "id": "49b17b8d-696d-45db-b586-fa4b767855e3",
                    "name": "签收表单",
                    "key": "shopping_sign_form"
                  },
                  "duedatedefinition": "",
                  "prioritydefinition": "",
                  "formproperties": {
                    "formProperties": [
                      {
                        "id": "signStatus",
                        "name": "签收状态",
                        "type": "boolean",
                        "readable": true,
                        "writable": true,
                        "$$hashKey": "uiGrid-0I9"
                      }
                    ]
                  },
                  "tasklisteners": ""
                },
                "stencil": {
                  "id": "UserTask"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-F222F2B7-D619-4491-855C-0C2C39D83964"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 666,
                    "y": 94.45931758530185
                  },
                  "upperLeft": {
                    "x": 566,
                    "y": 14.459317585301847
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-30541F3D-2836-47D6-A99F-7B33DEA5CB09",
                "properties": {
                  "overrideid": "end",
                  "name": "结束",
                  "documentation": "",
                  "executionlisteners": ""
                },
                "stencil": {
                  "id": "EndNoneEvent"
                },
                "childShapes": [],
                "outgoing": [],
                "bounds": {
                  "lowerRight": {
                    "x": 739,
                    "y": 68.45931758530185
                  },
                  "upperLeft": {
                    "x": 711,
                    "y": 40.45931758530185
                  }
                },
                "dockers": []
              }
            ],
            "outgoing": [],
            "bounds": {
              "lowerRight": {
                "x": 808,
                "y": 487
              },
              "upperLeft": {
                "x": 30,
                "y": 333.54068241469815
              }
            },
            "dockers": []
          },
          {
            "resourceId": "sid-88D6AE28-094C-4AA8-A054-3B0037B54716",
            "properties": {
              "overrideid": "",
              "name": "电商平台",
              "documentation": "",
              "showcaption": true
            },
            "stencil": {
              "id": "Lane"
            },
            "childShapes": [
              {
                "resourceId": "sid-AA89F745-68D1-4A53-B648-6026012263E9",
                "properties": {
                  "overrideid": "",
                  "name": "是否通过",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "sequencefloworder": ""
                },
                "stencil": {
                  "id": "ExclusiveGateway"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-C5F07952-E747-4C1F-95AB-B5B50EE52F56"
                  },
                  {
                    "resourceId": "sid-66ED5DD9-8167-4B33-A17B-AF807999AE97"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 331,
                    "y": 94.45931758530185
                  },
                  "upperLeft": {
                    "x": 291,
                    "y": 54.45931758530185
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-154778BE-012C-47DD-9CBD-F16E3E555A75",
                "properties": {
                  "overrideid": "",
                  "name": "",
                  "documentation": "",
                  "executionlisteners": ""
                },
                "stencil": {
                  "id": "EndNoneEvent"
                },
                "childShapes": [],
                "outgoing": [],
                "bounds": {
                  "lowerRight": {
                    "x": 404,
                    "y": 88.45931758530185
                  },
                  "upperLeft": {
                    "x": 376,
                    "y": 60.45931758530185
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-671B0208-AF05-4949-BCFD-63E23323510A",
                "properties": {
                  "overrideid": "userTaskConfirm",
                  "name": "确认订单",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "executionlisteners": "",
                  "multiinstance_type": "None",
                  "multiinstance_cardinality": "",
                  "multiinstance_collection": "",
                  "multiinstance_variable": "",
                  "multiinstance_condition": "",
                  "isforcompensation": "false",
                  "usertaskassignment": {
                    "assignment": {
                      "type": "idm",
                      "idm": {
                        "type": "users",
                        "candidateUsers": [
                          {
                            "id": "shopA",
                            "firstName": "shop",
                            "lastName": "A",
                            "email": "shopA@126.com",
                            "fullName": "shop A",
                            "groups": [],
                            "$$hashKey": "object:1080"
                          },
                          {
                            "id": "shopB",
                            "firstName": "shop",
                            "lastName": "B",
                            "email": "shopB@126.com",
                            "fullName": "shop B",
                            "groups": [],
                            "$$hashKey": "object:1081"
                          }
                        ]
                      },
                      "initiatorCanCompleteTask": false
                    }
                  },
                  "formkeydefinition": "",
                  "formreference": {
                    "id": "3a80c67e-3ccb-4782-a972-f155539b46b3",
                    "name": "确认订单表单",
                    "key": "shopping_confirm_form"
                  },
                  "duedatedefinition": "",
                  "prioritydefinition": "",
                  "formproperties": {
                    "formProperties": [
                      {
                        "id": "payConfirm",
                        "name": "支付确认",
                        "type": "string",
                        "readable": true,
                        "writable": true,
                        "variable": "",
                        "$$hashKey": "uiGrid-0FT"
                      }
                    ]
                  },
                  "tasklisteners": ""
                },
                "stencil": {
                  "id": "UserTask"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-F766A310-7646-4CA7-81BB-3CB8EF9C1D49"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 531,
                    "y": 103.45931758530185
                  },
                  "upperLeft": {
                    "x": 431,
                    "y": 23.459317585301847
                  }
                },
                "dockers": []
              },
              {
                "resourceId": "sid-03BF1C40-F062-42F1-B411-3ECC3BD31F1C",
                "properties": {
                  "scriptformat": "groovy",
                  "scripttext": "def productCount =  execution.getVariable("productCount")
System.out.println("productCount = "+productCount)
   if(productCount > 10){
     execution.setVariable("verifyResult",false)
   }else{
     execution.setVariable("verifyResult",true)
   }",
                  "overrideid": "userTaskVerify",
                  "name": "库存校验",
                  "documentation": "",
                  "asynchronousdefinition": "false",
                  "exclusivedefinition": "false",
                  "executionlisteners": "",
                  "multiinstance_type": "None",
                  "multiinstance_cardinality": "",
                  "multiinstance_collection": "",
                  "multiinstance_variable": "",
                  "multiinstance_condition": "",
                  "isforcompensation": "false",
                  "type": "http://b3mn.org/stencilset/bpmn2.0#UserTask",
                  "tasklisteners": "",
                  "formproperties": "",
                  "prioritydefinition": "",
                  "duedatedefinition": "",
                  "formreference": "",
                  "formkeydefinition": "",
                  "usertaskassignment": "",
                  "servicetaskresultvariable": "",
                  "servicetaskfields": "",
                  "servicetaskdelegateexpression": "",
                  "servicetaskexpression": "",
                  "servicetaskclass": "com.imooc.workflow.delegate.VerifyJavaDelegate"
                },
                "stencil": {
                  "id": "ScriptTask"
                },
                "childShapes": [],
                "outgoing": [
                  {
                    "resourceId": "sid-FC4B063D-392A-42FD-AF11-8205024B66B2"
                  }
                ],
                "bounds": {
                  "lowerRight": {
                    "x": 246,
                    "y": 114.45931758530185
                  },
                  "upperLeft": {
                    "x": 146,
                    "y": 34.45931758530185
                  }
                },
                "dockers": []
              }
            ],
            "outgoing": [],
            "bounds": {
              "lowerRight": {
                "x": 808,
                "y": 333.54068241469815
              },
              "upperLeft": {
                "x": 30,
                "y": 174.54068241469815
              }
            },
            "dockers": []
          }
        ],
        "outgoing": [],
        "bounds": {
          "lowerRight": {
            "x": 812,
            "y": 439
          },
          "upperLeft": {
            "x": 4,
            "y": -48
          }
        },
        "dockers": []
      },
      {
        "resourceId": "sid-9C6EABB6-A184-46D2-9751-7CD7363E22E7",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false"
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-371F6123-FE90-4750-AC5C-475F62C7FB04"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 179.15625,
            "y": 355
          },
          "upperLeft": {
            "x": 135.609375,
            "y": 355
          }
        },
        "dockers": [
          {
            "x": 15,
            "y": 15
          },
          {
            "x": 50,
            "y": 40
          }
        ],
        "target": {
          "resourceId": "sid-371F6123-FE90-4750-AC5C-475F62C7FB04"
        }
      },
      {
        "resourceId": "sid-C2006C15-367F-47DB-83B3-0FF306D3592C",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false"
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-03BF1C40-F062-42F1-B411-3ECC3BD31F1C"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 230,
            "y": 314.296875
          },
          "upperLeft": {
            "x": 230,
            "y": 241.703125
          }
        },
        "dockers": [
          {
            "x": 50,
            "y": 40
          },
          {
            "x": 50,
            "y": 40
          }
        ],
        "target": {
          "resourceId": "sid-03BF1C40-F062-42F1-B411-3ECC3BD31F1C"
        }
      },
      {
        "resourceId": "sid-FC4B063D-392A-42FD-AF11-8205024B66B2",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false"
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-AA89F745-68D1-4A53-B648-6026012263E9"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 324.64844687000755,
            "y": 201.4097335362338
          },
          "upperLeft": {
            "x": 280.62889687999245,
            "y": 201.2191727137662
          }
        },
        "dockers": [
          {
            "x": 50,
            "y": 40
          },
          {
            "x": 20.5,
            "y": 20.5
          }
        ],
        "target": {
          "resourceId": "sid-AA89F745-68D1-4A53-B648-6026012263E9"
        }
      },
      {
        "resourceId": "sid-43EEC3C2-9765-4589-A7CF-9B8B621A7E26",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false",
          "showdiamondmarker": false
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-671B0208-AF05-4949-BCFD-63E23323510A"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 515,
            "y": 362.2703412073491
          },
          "upperLeft": {
            "x": 395.9453125,
            "y": 230.5205872703412
          }
        },
        "dockers": [
          {
            "x": 99,
            "y": 40
          },
          {
            "x": 515,
            "y": 362.2703412073491
          },
          {
            "x": 50,
            "y": 79
          }
        ],
        "target": {
          "resourceId": "sid-671B0208-AF05-4949-BCFD-63E23323510A"
        }
      },
      {
        "resourceId": "sid-F766A310-7646-4CA7-81BB-3CB8EF9C1D49",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false"
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-B823EABC-63CA-462F-998D-F700B31C751F"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 515,
            "y": 149.15625
          },
          "upperLeft": {
            "x": 515,
            "y": 80.84375
          }
        },
        "dockers": [
          {
            "x": 50,
            "y": 40
          },
          {
            "x": 50,
            "y": 40
          }
        ],
        "target": {
          "resourceId": "sid-B823EABC-63CA-462F-998D-F700B31C751F"
        }
      },
      {
        "resourceId": "sid-F222F2B7-D619-4491-855C-0C2C39D83964",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false"
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-30541F3D-2836-47D6-A99F-7B33DEA5CB09"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 744.375,
            "y": 340
          },
          "upperLeft": {
            "x": 700.390625,
            "y": 340
          }
        },
        "dockers": [
          {
            "x": 50,
            "y": 40
          },
          {
            "x": 14,
            "y": 14
          }
        ],
        "target": {
          "resourceId": "sid-30541F3D-2836-47D6-A99F-7B33DEA5CB09"
        }
      },
      {
        "resourceId": "sid-2033F964-1F9C-43FC-8689-089F34C76A3B",
        "properties": {
          "overrideid": "",
          "name": "",
          "documentation": "",
          "conditionsequenceflow": "",
          "executionlisteners": "",
          "defaultflow": "false",
          "showdiamondmarker": false
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-1F948474-0744-4D1D-B9D0-F5545EFFABF1"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 650,
            "y": 299.15625
          },
          "upperLeft": {
            "x": 565.671875,
            "y": 40
          }
        },
        "dockers": [
          {
            "x": 99,
            "y": 40
          },
          {
            "x": 650,
            "y": 40
          },
          {
            "x": 50,
            "y": 40
          }
        ],
        "target": {
          "resourceId": "sid-1F948474-0744-4D1D-B9D0-F5545EFFABF1"
        }
      },
      {
        "resourceId": "sid-C5F07952-E747-4C1F-95AB-B5B50EE52F56",
        "properties": {
          "overrideid": "",
          "name": "校验失败结束",
          "documentation": "",
          "conditionsequenceflow": {
            "expression": {
              "type": "static",
              "staticValue": "${verifyResult == false}"
            }
          },
          "executionlisteners": "",
          "defaultflow": false
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-154778BE-012C-47DD-9CBD-F16E3E555A75"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 409.5078327841814,
            "y": 201.376443202447
          },
          "upperLeft": {
            "x": 364.8984172158186,
            "y": 201.092306797553
          }
        },
        "dockers": [
          {
            "x": 20.5,
            "y": 20.5
          },
          {
            "x": 14,
            "y": 14
          }
        ],
        "target": {
          "resourceId": "sid-154778BE-012C-47DD-9CBD-F16E3E555A75"
        }
      },
      {
        "resourceId": "sid-66ED5DD9-8167-4B33-A17B-AF807999AE97",
        "properties": {
          "overrideid": "",
          "name": "通过校验去支付",
          "documentation": "",
          "conditionsequenceflow": {
            "expression": {
              "type": "static",
              "staticValue": "${verifyResult == true}"
            }
          },
          "executionlisteners": "",
          "defaultflow": false
        },
        "stencil": {
          "id": "SequenceFlow"
        },
        "childShapes": [],
        "outgoing": [
          {
            "resourceId": "sid-52961534-9BDC-4CEF-BB25-85B0F4FAF04B"
          }
        ],
        "bounds": {
          "lowerRight": {
            "x": 345.4382962386745,
            "y": 321.70576988694995
          },
          "upperLeft": {
            "x": 345.1261568863255,
            "y": 221.3402695241393
          }
        },
        "dockers": [
          {
            "x": 20.5,
            "y": 20.5
          },
          {
            "x": 50,
            "y": 40
          }
        ],
        "target": {
          "resourceId": "sid-52961534-9BDC-4CEF-BB25-85B0F4FAF04B"
        }
      }
    ],
    "bounds": {
      "lowerRight": {
        "x": 1200,
        "y": 1050
      },
      "upperLeft": {
        "x": 0,
        "y": 0
      }
    },
    "stencilset": {
      "url": "stencilsets/bpmn2.0/bpmn2.0.json",
      "namespace": "http://b3mn.org/stencilset/bpmn2.0#"
    },
    "ssextensions": []
  }
}

shopping_booking_form.json

{
  "id": "8360617e-9a88-497a-91f0-b9d467a862f3",
  "name": "下单表单",
  "key": "shopping_booking_form",
  "description": "shopping_booking_form下单表单",
  "editorJson": {
    "name": "下单表单",
    "key": "shopping_booking_form",
    "version": 0,
    "fields": [
      {
        "fieldType": "FormField",
        "id": "productName",
        "name": "商品名称",
        "type": "text",
        "value": null,
        "required": false,
        "readOnly": false,
        "overrideId": true,
        "placeholder": null,
        "layout": null,
        "sizeX": 0,
        "sizeY": 0
      },
      {
        "fieldType": "FormField",
        "id": "productCount",
        "name": "商品数量",
        "type": "integer",
        "value": null,
        "required": true,
        "readOnly": false,
        "overrideId": true,
        "placeholder": "1",
        "layout": null,
        "sizeX": 0,
        "sizeY": 0
      },
      {
        "fieldType": "FormField",
        "id": "productAmount",
        "name": "总金额",
        "type": "integer",
        "value": null,
        "required": false,
        "readOnly": false,
        "overrideId": true,
        "placeholder": null,
        "layout": null,
        "sizeX": 0,
        "sizeY": 0
      },
      {
        "fieldType": "FormField",
        "id": "contactName",
        "name": "联系人姓名",
        "type": "text",
        "value": null,
        "required": false,
        "readOnly": false,
        "overrideId": true,
        "placeholder": null,
        "layout": null,
        "sizeX": 0,
        "sizeY": 0
      },
      {
        "fieldType": "FormField",
        "id": "contactPhone",
        "name": "联系人电话",
        "type": "text",
        "value": null,
        "required": false,
        "readOnly": false,
        "overrideId": true,
        "placeholder": null,
        "layout": null,
        "sizeX": 0,
        "sizeY": 0
      }
    ],
    "outcomes": []
  }
}
点击查看更多内容
5人点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消