Flowable 基本用法

一、简介

Flowable 是一个用 Java 编写的轻量级业务流程引擎。Flowable 流程引擎允许您部署 BPMN 2.0 流程定义(用于定义流程的行业 XML 标准)、创建这些流程定义的流程实例、运行查询、访问活动或历史流程实例和相关数据

Flowable 在将其添加到应用程序、服务、体系结构时非常灵活。您可以将引擎嵌入到您的应用程序或服务中,方法是包含 Flowable 库,该库作为 JAR 提供。因为它是一个 JAR,所以可以很容易地将它添加到任何 Java 环境中:javase;servlet 容器,如 Tomcat或 Jetty、Spring;javaee 服务器,如 JBoss 或 WebSphere 等。或者,您可以使用可流动的 restapi 通过 HTTP 进行通信。还有一些可流动的应用程序(Flowable Modeler、Flowable Admin、Flowable IDM 和 Flowable Task),它们提供了用于处理流程和任务的现成示例 UI。

二、Flowable UI 的安装部署

首先下载文件 Flowable 相关的资源,下载下来以后有如图两个文件:

将这两个文件复制到Tomcat文件夹下:

右击在资源管理器中启动输入

java -jar flowable-ui.war

启动之后会显示

如果一闪而过则检查 jdk 的环境变量配置。启动成功后,在浏览器中访问 http://localhost:8080/flowable-ui/#/,默认的账号密码是:admin/test

进入之后:

创建一个用户

然后授予权限

三、绘制工作流程图

回到主页,打开建模器应用程序

然后创建流程

创建完毕

  • 主键 ID:可以结合业务需求,业务可以根据不同步骤执行不同的业务操作
  • 分配用户:这里为了方便,直接选择了固定值,这里的候选组是具体的业务系统的角色 ID 从而实现不同角色审批不同流程的效果

画完

下载工作流程图

<?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:flowable="http://flowable.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.flowable.org/processdef" exporter="Flowable Open Source Modeler" exporterVersion="6.7.2">
  <process id="a1" name="Myfirst-CTB" isExecutable="true">
    <startEvent id="startEvent1" flowable:formFieldValidation="true"></startEvent>
    <userTask id="sid-874A9365-4D7A-413C-BB21-4773530BAAAC" name="测试一下" flowable:formFieldValidation="true"></userTask>
    <sequenceFlow id="sid-CB16684B-AE18-444D-80E8-44185DC39CE4" sourceRef="startEvent1" targetRef="sid-874A9365-4D7A-413C-BB21-4773530BAAAC"></sequenceFlow>
    <exclusiveGateway id="sid-B6CE259C-B065-4B74-B922-AD33768C9EC2"></exclusiveGateway>
    <endEvent id="sid-33C4DAD4-E09E-44DB-9897-C69D52631577"></endEvent>
    <sequenceFlow id="sid-462D6D36-E48C-43E7-AECF-27E6B903605F" name="同意" sourceRef="sid-B6CE259C-B065-4B74-B922-AD33768C9EC2" targetRef="sid-33C4DAD4-E09E-44DB-9897-C69D52631577">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${executeType=='YES'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="sid-D231B9F3-C63C-4AF8-AEAE-8F9AB52B5481" sourceRef="sid-874A9365-4D7A-413C-BB21-4773530BAAAC" targetRef="sid-B6CE259C-B065-4B74-B922-AD33768C9EC2">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${executeType=='YES'}]]></conditionExpression>
    </sequenceFlow>
    <endEvent id="sid-81CC6B7F-36C6-42FD-B285-5C74B58C8725"></endEvent>
    <sequenceFlow id="sid-1DDBDE16-19CF-4697-93E5-950FF37D8FEE" name="拒绝" sourceRef="sid-B6CE259C-B065-4B74-B922-AD33768C9EC2" targetRef="sid-81CC6B7F-36C6-42FD-B285-5C74B58C8725">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${executeType=='NO'}]]></conditionExpression>
    </sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_a1">
    <bpmndi:BPMNPlane bpmnElement="a1" id="BPMNPlane_a1">
      <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
        <omgdc:Bounds height="30.0" width="30.0" x="105.0" y="163.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-874A9365-4D7A-413C-BB21-4773530BAAAC" id="BPMNShape_sid-874A9365-4D7A-413C-BB21-4773530BAAAC">
        <omgdc:Bounds height="80.0" width="100.0" x="225.0" y="138.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-B6CE259C-B065-4B74-B922-AD33768C9EC2" id="BPMNShape_sid-B6CE259C-B065-4B74-B922-AD33768C9EC2">
        <omgdc:Bounds height="40.0" width="40.0" x="465.0" y="158.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-33C4DAD4-E09E-44DB-9897-C69D52631577" id="BPMNShape_sid-33C4DAD4-E09E-44DB-9897-C69D52631577">
        <omgdc:Bounds height="28.0" width="28.0" x="635.5" y="164.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sid-81CC6B7F-36C6-42FD-B285-5C74B58C8725" id="BPMNShape_sid-81CC6B7F-36C6-42FD-B285-5C74B58C8725">
        <omgdc:Bounds height="28.0" width="28.0" x="471.0" y="293.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="sid-462D6D36-E48C-43E7-AECF-27E6B903605F" id="BPMNEdge_sid-462D6D36-E48C-43E7-AECF-27E6B903605F" flowable:sourceDockerX="20.5" flowable:sourceDockerY="20.5" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0">
        <omgdi:waypoint x="504.50212408312484" y="178.44189602446482"></omgdi:waypoint>
        <omgdi:waypoint x="635.5000622194184" y="178.04253044527786"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-D231B9F3-C63C-4AF8-AEAE-8F9AB52B5481" id="BPMNEdge_sid-D231B9F3-C63C-4AF8-AEAE-8F9AB52B5481" flowable:sourceDockerX="50.0" flowable:sourceDockerY="40.0" flowable:targetDockerX="20.5" flowable:targetDockerY="20.5">
        <omgdi:waypoint x="324.9499999999905" y="178.11864608076007"></omgdi:waypoint>
        <omgdi:waypoint x="465.45238095238096" y="178.45238095238096"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-CB16684B-AE18-444D-80E8-44185DC39CE4" id="BPMNEdge_sid-CB16684B-AE18-444D-80E8-44185DC39CE4" flowable:sourceDockerX="15.0" flowable:sourceDockerY="15.0" flowable:targetDockerX="50.0" flowable:targetDockerY="40.0">
        <omgdi:waypoint x="134.9499992392744" y="178.0"></omgdi:waypoint>
        <omgdi:waypoint x="224.9999999999684" y="178.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="sid-1DDBDE16-19CF-4697-93E5-950FF37D8FEE" id="BPMNEdge_sid-1DDBDE16-19CF-4697-93E5-950FF37D8FEE" flowable:sourceDockerX="20.5" flowable:sourceDockerY="20.5" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0">
        <omgdi:waypoint x="485.42578125" y="197.51656908665106"></omgdi:waypoint>
        <omgdi:waypoint x="485.0542797509776" y="293.0001043765593"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

相关推荐

  1. Tinyxml基本

    2024-04-22 07:58:03       39 阅读
  2. ansible 基本

    2024-04-22 07:58:03       43 阅读
  3. Vue基本

    2024-04-22 07:58:03       21 阅读
  4. ElasticSearch基本

    2024-04-22 07:58:03       7 阅读
  5. pymysql的基本

    2024-04-22 07:58:03       37 阅读
  6. tar 命令基本

    2024-04-22 07:58:03       34 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-22 07:58:03       14 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-22 07:58:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-22 07:58:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-22 07:58:03       18 阅读

热门阅读

  1. TypeScript中什么是类类型接口?

    2024-04-22 07:58:03       14 阅读
  2. conda离线状态安装环境:更快安装环境的方式

    2024-04-22 07:58:03       12 阅读
  3. MySQL数据库——17.正则表达式

    2024-04-22 07:58:03       14 阅读
  4. 在ts中const和readonly区别?

    2024-04-22 07:58:03       14 阅读
  5. 课时101:正则表达式_基础实践_字符匹配

    2024-04-22 07:58:03       16 阅读
  6. 数据结构-排序

    2024-04-22 07:58:03       14 阅读
  7. 身份证实名接口和身份证OCR接口的组合使用

    2024-04-22 07:58:03       16 阅读
  8. 商用无线通信:信道带宽

    2024-04-22 07:58:03       13 阅读
  9. Docker搭建MySQL Workbench

    2024-04-22 07:58:03       14 阅读
  10. 变量和函数提升(js的问题)

    2024-04-22 07:58:03       12 阅读
  11. 001 redis高并发减库存

    2024-04-22 07:58:03       14 阅读