FlowableUI应用
Flowable提供了几个web应用,用于演示及介绍Flowable项目提供的功能:
- Flowable IDM: 身份管理应用。为所有Flowable UI应用提供单点登录认证功能,并且为拥有IDM管理员权限的用户提供了管理用户、组与权限的功能。
- Flowable Modeler: 让具有建模权限的用户可以创建流程模型、表单、选择表与应用定义。
- Flowable Task: 运行时任务应用。提供了启动流程实例、编辑任务表单、完成任务,以及查询流程实例与任务的功能。
- Flowable Admin: 管理应用。让具有管理员权限的用户可以查询BPMN、DMN、Form及Content引擎,并提供了许多选项用于修改流程实例、任务、作业等。管理应用通过REST API连接至引擎,并与Flowable Task应用及Flowable REST应用一同部署。
所有其他的应用都需要Flowable IDM提供认证。每个应用的WAR文件可以部署在相同的servlet容器(如Apache Tomcat)中,也可以部署在不同的容器中。由于每个应用使用相同的cookie进行认证,因此应用需要运行在相同的域名下。
1、部署
下载Tomcat:https://tomcat.apache.org/download-80.cgi 官网下载后解压缩到非中文目录即可,然后是下载FlowableUI的文件,在Flowable6.6之后把FlowableUI中提供的四个功能合并到了一起。
然后把解压缩后的两个war包(flowable-rest.war、flowable-ui.war)拷贝到Tomcat的解压缩的webapps目录下:
2、启动服务
启动Tomcat服务:
启动成功后,在浏览器中访问 http://localhost:8080/flowable-ui, 默认的账号密码是 admin/test
3、用户管理
创建用户
授权管理
4、绘制流程
创建新的流程
流程图界面
分配处理人
5、部署流程
绘制好的流程图,我们只需要一键导出即可
<?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="MyProcess" name="MyProcess" isExecutable="true">
<documentation>hello world</documentation>
<startEvent id="startEvent1" flowable:formFieldValidation="true"></startEvent>
<userTask id="sid-942EB1C8-C47B-4DC6-A4AF-47AFEA7C81D4" name="用户任务" flowable:assignee="1001" flowable:formFieldValidation="true">
<extensionElements>
<modeler:activiti-idm-assignee xmlns:modeler="http://flowable.org/modeler"><![CDATA[true]]></modeler:activiti-idm-assignee>
<modeler:assignee-info-email xmlns:modeler="http://flowable.org/modeler"><![CDATA[123@qq.com]]></modeler:assignee-info-email>
<modeler:assignee-info-firstname xmlns:modeler="http://flowable.org/modeler"><![CDATA[acton]]></modeler:assignee-info-firstname>
<modeler:assignee-info-lastname xmlns:modeler="http://flowable.org/modeler"><![CDATA[zhang]]></modeler:assignee-info-lastname>
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sid-1B8623A4-2242-431B-A0FB-F12A34F97372" sourceRef="startEvent1" targetRef="sid-942EB1C8-C47B-4DC6-A4AF-47AFEA7C81D4"></sequenceFlow>
<endEvent id="sid-49242385-9195-4EA7-82EA-E6E438955BDC"></endEvent>
<sequenceFlow id="sid-B7564411-578E-4902-BE14-893A225583DD" sourceRef="sid-942EB1C8-C47B-4DC6-A4AF-47AFEA7C81D4" targetRef="sid-49242385-9195-4EA7-82EA-E6E438955BDC"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_MyProcess">
<bpmndi:BPMNPlane bpmnElement="MyProcess" id="BPMNPlane_MyProcess">
<bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
<omgdc:Bounds height="30.0" width="30.0" x="100.0" y="163.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-942EB1C8-C47B-4DC6-A4AF-47AFEA7C81D4" id="BPMNShape_sid-942EB1C8-C47B-4DC6-A4AF-47AFEA7C81D4">
<omgdc:Bounds height="80.0" width="100.0" x="225.0" y="135.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-49242385-9195-4EA7-82EA-E6E438955BDC" id="BPMNShape_sid-49242385-9195-4EA7-82EA-E6E438955BDC">
<omgdc:Bounds height="28.0" width="28.0" x="405.0" y="162.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-1B8623A4-2242-431B-A0FB-F12A34F97372" id="BPMNEdge_sid-1B8623A4-2242-431B-A0FB-F12A34F97372" flowable:sourceDockerX="15.0" flowable:sourceDockerY="15.0" flowable:targetDockerX="50.0" flowable:targetDockerY="40.0">
<omgdi:waypoint x="129.9474255708386" y="177.71879843198602"></omgdi:waypoint>
<omgdi:waypoint x="225.0" y="175.9365625"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-B7564411-578E-4902-BE14-893A225583DD" id="BPMNEdge_sid-B7564411-578E-4902-BE14-893A225583DD" flowable:sourceDockerX="50.0" flowable:sourceDockerY="40.0" flowable:targetDockerX="14.0" flowable:targetDockerY="14.0">
<omgdi:waypoint x="324.94999999998726" y="175.0"></omgdi:waypoint>
<omgdi:waypoint x="365.0" y="175.0"></omgdi:waypoint>
<omgdi:waypoint x="365.0" y="176.0"></omgdi:waypoint>
<omgdi:waypoint x="405.0" y="176.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
6、演示
创建一个新的应用程序,并指定相关的信息
发布应用程序
发布了应用程序后我们就可以来启动流程了
切换为被分配的用户登录(1001/123),以便完成任务: