1. flowable-ui
目前flowable-ui主要用于画流程图,流程图画完之后,再对XML做适当的修改
docker安装使用flowable
docker run -d -p 8080:8080 flowable/all-in-one
进入flowable-ui界面
http://127.0.0.1:8080/flowable-modeler
2. springboot 使用
2.1 准备流程文件
Holiday_Request.bpmn20.xml,将文件放在resource/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: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"> <process id="holiday-request" name="Holiday Request" isExecutable="true">
<startEvent id="startEvent" flowable:formFieldValidation="true"></startEvent>
<sequenceFlow id="sequenceFlow-df79157f-2c4c-467c-8f27-50e3e1c65795" sourceRef="startEvent" targetRef="approveTask"></sequenceFlow>
<userTask id="approveTask" name="Approve or reject request" flowable:candidateGroups="dept-managers" flowable:formFieldValidation="true"></userTask>
<sequenceFlow id="sequenceFlow-e262d0a2-be78-462e-a382-58a507462e77" sourceRef="approveTask" targetRef="decision"></sequenceFlow>
<exclusiveGateway id="decision"></exclusiveGateway>
<sequenceFlow id="sequenceFlow-4395dd85-dfe3-41e1-9160-5f47ac0755a7" sourceRef="decision" targetRef="externalSystemCall">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approved}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="sequenceFlow-17d5b350-554f-40ad-a475-b38196d562d7" sourceRef="decision" targetRef="sendRejectionMail">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approved}]]></conditionExpression>
</sequenceFlow>
<serviceTask id="externalSystemCall" name="Enter holidays in external system" flowable:class="com.hsm.flow.callback.HolidayCallback"></serviceTask>
<sequenceFlow id="sequenceFlow-a0666bbf-eccf-4c2f-8567-6131445fa9b6" sourceRef="externalSystemCall" targetRef="holidayApprovedTask"></sequenceFlow>
<userTask id="holidayApprovedTask" name="Holiday approved" flowable:assignee="managers" flowable:formFieldValidation="true">
<extensionElements>
<modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler"><![CDATA[false]]></modeler:initiator-can-complete>
</extensionElements>
</userTask>
<sequenceFlow id="sequenceFlow-e7697e72-a60f-4b97-9cde-7af165951805" sourceRef="holidayApprovedTask" targetRef="approveEnd"></sequenceFlow>
<serviceTask id="sendRejectionMail" name="Send out rejection email" flowable:class="com.hsm.flow.callback.SendRejectionMailCallback"></serviceTask>
<sequenceFlow id