Idea+bpmn教程

        1.首先Idea先下载安装bpmn插件,网上很多教程,最好utf-8那个设置也一起加上

        2.网上搜索springboot+bpmn很多教程,这里就不介绍工程搭建,会有很多数据库表,我们只需要把精力放在流程的设计上

       参考:   https://blog.csdn.net/ssyujay/article/details/83896809?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

        3.以下以用户发起用章申请为案例

        3.1 在resource下创建bpmn文件,文件名最好带上xxxx20.bpmn

        3.2 先拖动StartEvent,再把鼠标点击空白位置,name对应值为 用章申请

        3.3 创建发起流程节点,这里面的formkey ,因为我的框架是springmvc的结构,所以写的是控制器的地址

        3.4 添加审批人,拖动右边UserTask

        3.5 增加判断

       3.6 增加重新申请的判断,其中 Assignee 字段很关键,第一步发起流程的时候就是使用这个字段,因为这里需要回填数据,所以需要再次带上这个字段,注意写法规范。

   4.以上就是简单的用章申请页面设计步骤,下面附上教程里面的xml格式的代码

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" 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" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1595902519534" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
  <process id="myProcess_1" isClosed="false" isExecutable="true" name="用章申请" processType="None">
    <startEvent activiti:formKey="/chapter/testActivitiChapter/form/add" activiti:initiator="applyUserId" id="_3" name="发起用章申请"/>
    <userTask activiti:assignee="admin" activiti:candidateUsers="admin" activiti:exclusive="true" activiti:formKey="/chapter/testActivitiChapter/form/audit" id="_4" name="领导审批"/>
    <sequenceFlow id="_5" sourceRef="_3" targetRef="_4"/>
    <exclusiveGateway gatewayDirection="Unspecified" id="_6" name="ExclusiveGateway"/>
    <sequenceFlow id="_7" sourceRef="_4" targetRef="_6"/>
    <userTask activiti:assignee="${applyUserId}" activiti:exclusive="true" id="_8" name="重新调整"/>
    <endEvent id="_9" name="结束流程"/>
    <sequenceFlow id="_10" name="不同意" sourceRef="_6" targetRef="_8">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_11" name="同意" sourceRef="_6" targetRef="_9">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass}]]></conditionExpression>
    </sequenceFlow>
    <exclusiveGateway gatewayDirection="Unspecified" id="_12" name="ExclusiveGateway"/>
    <sequenceFlow id="_13" sourceRef="_8" targetRef="_12"/>
    <sequenceFlow id="_14" name="重新申请" sourceRef="_12" targetRef="_4">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${reapply}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_15" name="结束申请" sourceRef="_12" targetRef="_9">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!reapply]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram documentation="background=#3C3F41;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
    <bpmndi:BPMNPlane bpmnElement="myProcess_1">
      <bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
        <omgdc:Bounds height="32.0" width="32.0" x="295.0" y="90.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
        <omgdc:Bounds height="55.0" width="85.0" x="280.0" y="215.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_6" id="Shape-_6" isMarkerVisible="false">
        <omgdc:Bounds height="32.0" width="32.0" x="285.0" y="360.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_8" id="Shape-_8">
        <omgdc:Bounds height="55.0" width="85.0" x="425.0" y="360.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_9" id="Shape-_9">
        <omgdc:Bounds height="32.0" width="32.0" x="270.0" y="500.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_12" id="Shape-_12" isMarkerVisible="false">
        <omgdc:Bounds height="32.0" width="32.0" x="590.0" y="370.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="_13" id="BPMNEdge__13" sourceElement="_8" targetElement="_12">
        <omgdi:waypoint x="510.0" y="387.5"/>
        <omgdi:waypoint x="590.0" y="386.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_15" id="BPMNEdge__15" sourceElement="_12" targetElement="_9">
        <omgdi:waypoint x="610.0" y="398.0"/>
        <omgdi:waypoint x="610.0" y="455.0"/>
        <omgdi:waypoint x="302.0" y="516.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_14" id="BPMNEdge__14" sourceElement="_12" targetElement="_4">
        <omgdi:waypoint x="610.0" y="374.0"/>
        <omgdi:waypoint x="610.0" y="305.0"/>
        <omgdi:waypoint x="365.0" y="242.5"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_5" id="BPMNEdge__5" sourceElement="_3" targetElement="_4">
        <omgdi:waypoint x="311.0" y="122.0"/>
        <omgdi:waypoint x="311.0" y="215.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_4" targetElement="_6">
        <omgdi:waypoint x="301.0" y="270.0"/>
        <omgdi:waypoint x="301.0" y="360.0"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_11" id="BPMNEdge__11" sourceElement="_6" targetElement="_9">
        <omgdi:waypoint x="293.5" y="384.5"/>
        <omgdi:waypoint x="293.5" y="501.8667059748974"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_10" id="BPMNEdge__10" sourceElement="_6" targetElement="_8">
        <omgdi:waypoint x="317.0" y="376.0"/>
        <omgdi:waypoint x="425.0" y="387.5"/>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

        5.使用工程框架自带的流程模板管理,上传上面创建的文件

        6.启动流程,跳转到我们发起流程填写的formkey的页面

        7.管理员审批

         8.被驳回了

    以上就是简单的用章申请的全部教程,其实主要是为了针对idea页面设计bpmn做个记录,网上搜了很多都是笼统的介绍。希望大家看到的时候能有个参考。

猜你喜欢

转载自blog.csdn.net/qq_33278354/article/details/107629911
今日推荐