springboot+flowable请假详细流程

本文详细介绍了如何使用SpringBoot结合Flowable搭建请假流程。首先通过flowable-ui绘制流程图,接着在SpringBoot应用中配置流程文件、数据源、流程引擎,并编写相关实体类和服务实现。流程说明依赖于XML文件和流程图的理解。
摘要由CSDN通过智能技术生成

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
  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值