jeecg-boot整合camunda工作流-串行流程

引言

UserTask用户任务,是需要人处理后才能流转的任务。

本文将构建一个简单的串行流程带大家快速入门camunda工作流。

需求

我们以三国为背景, 假设系统中拥有将军,军师,主公三种角色。

现在作为将军的关羽需要发动一个出征流程。在填写好出兵人数和攻占城市后。

流程流转到军事诸葛亮进行评审, 此时军事可以给出锦囊妙计。

军事同意后,由主公角色刘备进行最后裁断,并赐予战甲等物资。

建模

xml 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1g84ud8" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.10.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.19.0">
  <bpmn:process id="Process_0c2xy49" name="出征流程" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1" camunda:initiator="start">
      <bpmn:outgoing>Flow_0fq95hn</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_0fq95hn" sourceRef="StartEvent_1" targetRef="Activity_0rbn70i" />
    <bpmn:userTask id="Activity_0rbn70i" name="出征申请" camunda:assignee="${general}">
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="number" label="出兵人数" type="long" defaultValue="1000" />
          <camunda:formField id="city" label="攻取城市" type="string" defaultValue="许昌" />
        </camunda:formData>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0fq95hn</bpmn:incoming>
      <bpmn:outgoing>Flow_01kvxy5</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_01kvxy5" sourceRef="Activity_0rbn70i" targetRef="Activity_1rht9n2" />
    <bpmn:userTask id="Activity_1rht9n2" name="军师评审" camunda:assignee="${guide}">
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="comment" label="评论" type="string" defaultValue="good" />
          <camunda:formField id="imageUrl" label="图片" type="string" />
        </camunda:formData>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_01kvxy5</bpmn:incoming>
      <bpmn:outgoing>Flow_1whul4k</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sequenceFlow id="Flow_1whul4k" sourceRef="Activity_1rht9n2" targetRef="Activity_0n2qyol" />
    <bpmn:userTask id="Activity_0n2qyol" name="主公决断" camunda:assignee="${leader}">
      <bpmn:extensionElements>
        <camunda:formData>
          <camunda:formField id="comment" label="评论" type="string" defaultValue="ok" />
          <camunda:formField id="pass" label="通过" type="boolean" defaultValue="true" />
          <camunda:formField id="imageUrl" label="图片" type="string" />
        </camunda:formData>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_1whul4k</bpmn:incoming>
      <bpmn:outgoing>Flow_0f4i22k</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:endEvent id="Event_1i65d7z">
      <bpmn:incoming>Flow_0f4i22k</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0f4i22k" sourceRef="Activity_0n2qyol" targetRef="Event_1i65d7z" />
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_0c2xy49">
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1nusb4n_di" bpmnElement="Activity_0rbn70i">
        <dc:Bounds x="270" y="77" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1svhkoi_di" bpmnElement="Activity_1rht9n2">
        <dc:Bounds x="430" y="77" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_08bfhfu_di" bpmnElement="Activity_0n2qyol">
        <dc:Bounds x="590" y="77" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_1i65d7z_di" bpmnElement="Event_1i65d7z">
        <dc:Bounds x="752" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_0fq95hn_di" bpmnElement="Flow_0fq95hn">
        <di:waypoint x="215" y="117" />
        <di:waypoint x="270" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_01kvxy5_di" bpmnElement="Flow_01kvxy5">
        <di:waypoint x="370" y="117" />
        <di:waypoint x="430" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1whul4k_di" bpmnElement="Flow_1whul4k">
        <di:waypoint x="530" y="117" />
        <di:waypoint x="590" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0f4i22k_di" bpmnElement="Flow_0f4i22k">
        <di:waypoint x="690" y="117" />
        <di:waypoint x="752" y="117" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

角色扮演环节

接下来就是各个角色登录系统。完成各自的规定动作。促使整个流程平稳健康的运转。

将军-关羽

  • 关羽登录系统在测试流程菜单下发起一个出征流程。
  • 关羽可以通过我发起的菜单看到自己的发起记录。

将军-诸葛亮

  • 诸葛亮登录系统找到待办任务菜单,查询待办任务。
  • 诸葛亮找到已办任务菜单查询自己刚处理过的任务。

主公-刘备

  • 刘备登录系统找到待办任务菜单,查询待办任务。
  • 刘备找到已办任务菜单查询自己刚处理过的任务。

扩展

jeecg-boot整合camunda工作流-串行流程-B站教程

相关推荐
你的人类朋友7 小时前
说说git的变基
前端·git·后端
阿杆7 小时前
玩转 Amazon ElastiCache 免费套餐:小白也能上手
后端
阿杆7 小时前
无服务器每日自动推送 B 站热门视频
后端
公众号_醉鱼Java8 小时前
Elasticsearch 字段膨胀使用 Flattened类型
后端·掘金·金石计划
JohnYan9 小时前
工作笔记 - CentOS7环境运行Bun应用
javascript·后端·容器
探索java9 小时前
Netty Channel详解:从原理到实践
java·后端·netty
追逐时光者9 小时前
2025 年全面的 C#/.NET/.NET Core 学习路线集合,学习不迷路!
后端·.net
ankleless11 小时前
Spring Boot 实战:从项目搭建到部署优化
java·spring boot·后端
百锦再11 小时前
一文精通 Swagger 在 .NET 中的全方位配置与应用
后端·ui·.net·接口·配置·swagger·访问
用户48221371677511 小时前
C++——静态数组、动态数组
后端