Flowable 工作流API应用与数据库对应展示

模型保存

请求参数分析

流程基本信息 process

{

"id": "process_8616qrt8",

"name": "name_d5mdibck"

}

流程图位置信息 svg

XML 复制代码
<?xml version="1.0" encoding="utf-8"?>
<!-- created with bpmn-js / http://bpmn.io -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="322" height="97"
     viewBox="-31 154 322 97" version="1.1">
    <defs>
        <marker id="sequenceflow-end-white-black-3sruubs92w8hngtoqurf3y84v" viewBox="0 0 20 20" refX="11" refY="10"
                markerWidth="10" markerHeight="10" orient="auto">
            <path d="M 1 5 L 11 10 L 1 15 Z"
                  style="fill: black; stroke-width: 1px; stroke-linecap: round; stroke-dasharray: 10000, 1; stroke: black;"/>
        </marker>
    </defs>
    <g class="djs-group">
        <g class="djs-element djs-shape" data-element-id="Event_02lbc8a" style="display: block;"
           transform="matrix(1 0 0 1 222 182)">
            <g class="djs-visual">
                <circle cx="18" cy="18" r="18"
                        style="stroke: black; stroke-width: 4px; fill: white; fill-opacity: 0.95;"/>
            </g>
            <rect class="djs-hit djs-hit-all" x="0" y="0" width="36" height="36"
                  style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="-6" y="-6" width="48" height="48" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
    <g class="djs-group">
        <g class="djs-element djs-connection" data-element-id="Flow_00van8r" style="display: block;">
            <g class="djs-visual">
                <path d="m  160,200L222,200 "
                      style="fill: none; stroke-width: 2px; stroke: black; stroke-linejoin: round; marker-end: url('#sequenceflow-end-white-black-3sruubs92w8hngtoqurf3y84v');"/>
            </g>
            <polyline points="160,200 222,200 " class="djs-hit djs-hit-stroke"
                      style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="154" y="194" width="74" height="12" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
    <g class="djs-group">
        <g class="djs-element djs-connection" data-element-id="Flow_1eyb522" style="display: block;">
            <g class="djs-visual">
                <path d="m  5,200L60,200 "
                      style="fill: none; stroke-width: 2px; stroke: black; stroke-linejoin: round; marker-end: url('#sequenceflow-end-white-black-3sruubs92w8hngtoqurf3y84v');"/>
            </g>
            <polyline points="5,200 60,200 " class="djs-hit djs-hit-stroke"
                      style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="-1" y="194" width="67" height="12" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
    <g class="djs-group">
        <g class="djs-element djs-shape" data-element-id="event_start" style="display: block;"
           transform="matrix(1 0 0 1 -25 185)">
            <g class="djs-visual">
                <circle cx="15" cy="15" r="15"
                        style="stroke: black; stroke-width: 2px; fill: white; fill-opacity: 0.95;"/>
            </g>
            <rect class="djs-hit djs-hit-all" x="0" y="0" width="30" height="30"
                  style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="-6" y="-6" width="42" height="42" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
    <g class="djs-group">
        <g class="djs-element djs-shape" data-element-id="startNode1_label" style="display: block;"
           transform="matrix(1 0 0 1 -23 222)">
            <g class="djs-visual">
                <text lineHeight="1.2" class="djs-label"
                      style="font-family: Arial, sans-serif; font-size: 11px; font-weight: normal; fill: black;">
                    <tspan x="0" y="9.899999999999999">开始</tspan>
                </text>
            </g>
            <rect class="djs-hit djs-hit-all" x="0" y="0" width="23" height="14"
                  style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="-6" y="-6" width="35" height="26" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
    <g class="djs-group">
        <g class="djs-element djs-shape" data-element-id="khjl001" style="display: block;"
           transform="matrix(1 0 0 1 60 160)">
            <g class="djs-visual">
                <rect x="0" y="0" width="100" height="80" rx="10" ry="10"
                      style="stroke: black; stroke-width: 2px; fill: white; fill-opacity: 0.95;"/>
                <text lineHeight="1.2" class="djs-label"
                      style="font-family: Arial, sans-serif; font-size: 12px; font-weight: normal; fill: black;">
                    <tspan x="50" y="43.599999999999994"/>
                </text>
                <path d="m 15,12 c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"
                      style="fill: white; stroke-width: 0.5px; stroke: black;"/>
                <path d="m 15,12 m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "
                      style="fill: white; stroke-width: 0.5px; stroke: black;"/>
                <path d="m 15,12 m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"
                      style="fill: black; stroke-width: 0.5px; stroke: black;"/>
            </g>
            <rect class="djs-hit djs-hit-all" x="0" y="0" width="100" height="80"
                  style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="-6" y="-6" width="112" height="92" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
    <g class="djs-group">
        <g class="djs-element djs-shape" data-element-id="Event_02lbc8a_label" style="display: block;"
           transform="matrix(1 0 0 1 195 225)">
            <g class="djs-visual">
                <text lineHeight="1.2" class="djs-label"
                      style="font-family: Arial, sans-serif; font-size: 11px; font-weight: normal; fill: black;">
                    <tspan x="0" y="9.899999999999999">结束</tspan>
                </text>
            </g>
            <rect class="djs-hit djs-hit-all" x="0" y="0" width="90" height="20"
                  style="fill: none; stroke-opacity: 0; stroke: white; stroke-width: 15px;"/>
            <rect x="-6" y="-6" width="102" height="32" class="djs-outline" style="fill: none;"/>
        </g>
    </g>
</svg>

流程图实例信息(关键) xml

XML 复制代码
<?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:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
             xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0"
             xmlns:flowable="http://flowable.org/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.flowable.org/processdef">
    <process id="process_8616qrt8" name="name_d5mdibck">
        <documentation>随便一个</documentation>
        <extensionElements>
            <flowable:executionListener class="com.bu.xxx" event="take"/>
        </extensionElements>
        <startEvent id="event_start" name="开始" flowable:formKey="表单11key" flowable:initiator="zhangs">
            <documentation>开始节点</documentation>
            <outgoing>Flow_1eyb522</outgoing>
        </startEvent>
        <sequenceFlow id="Flow_1eyb522" sourceRef="event_start" targetRef="khjl001"/>
        <userTask id="khjl001" name="客户经理" flowable:candidateGroups="90112111">
            <documentation>客户经理</documentation>
            <incoming>Flow_1eyb522</incoming>
            <outgoing>Flow_00van8r</outgoing>
        </userTask>
        <endEvent id="Event_02lbc8a" name="结束">
            <documentation>结束节点</documentation>
            <extensionElements>
                <flowable:executionListener class="com.bu.xxx" event="end"/>
            </extensionElements>
            <incoming>Flow_00van8r</incoming>
        </endEvent>
        <sequenceFlow id="Flow_00van8r" sourceRef="khjl001" targetRef="Event_02lbc8a"/>
    </process>
    <bpmndi:BPMNDiagram id="BPMNDiagram_flow">
        <bpmndi:BPMNPlane id="BPMNPlane_flow" bpmnElement="process_8616qrt8">
            <bpmndi:BPMNEdge id="Flow_1eyb522_di" bpmnElement="Flow_1eyb522">
                <di:waypoint x="5" y="200"/>
                <di:waypoint x="60" y="200"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge id="Flow_00van8r_di" bpmnElement="Flow_00van8r">
                <di:waypoint x="160" y="200"/>
                <di:waypoint x="222" y="200"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNShape id="BPMNShape_startNode1" bpmnElement="event_start" bioc:stroke="">
                <omgdc:Bounds x="-25" y="185" width="30" height="30"/>
                <bpmndi:BPMNLabel>
                    <omgdc:Bounds x="-23" y="222" width="23" height="14"/>
                </bpmndi:BPMNLabel>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="Activity_17r1b2u_di" bpmnElement="khjl001">
                <omgdc:Bounds x="60" y="160" width="100" height="80"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape id="Event_02lbc8a_di" bpmnElement="Event_02lbc8a">
                <omgdc:Bounds x="222" y="182" width="36" height="36"/>
                <bpmndi:BPMNLabel>
                    <omgdc:Bounds x="195" y="225" width="90" height="20"/>
                </bpmndi:BPMNLabel>
            </bpmndi:BPMNShape>
        </bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>
</definitions>

流程部署API

核心 API

RepositoryService 负责deploy部署

java 复制代码
String tenantId = UUID.randomUUID().toString();
        repositoryService.createDeployment()
                .name(processName)
                // 租户
                .tenantId(tenantId)
                // 种类
                .category(processName)
                .deploymentProperty("name", processName)
                .deploymentProperty("path", processPath)
                // 工作流文件位置
                .addClasspathResource("processes/" + processPath)
                // 部署
                .deploy();

ACT_RE_DEPLOYMENT 存储部署信息 与 API 映射保持一致

复制代码
ACT_GE_BYTEARRAY [deployment_id] 流程资源 XML 信息 与 ACT_RE_DEPLOYMENT [id] 关联
复制代码
ACT_RE_PROCDEF [deployment_id] 流程基本信息 与 ACT_RE_DEPLOYMENT [id] 关联
相关推荐
opentrending1 小时前
Github 热点项目 awesome-mcp-servers MCP 服务器合集,3分钟实现AI模型自由操控万物!
服务器·人工智能·github
明天不下雨(牛客同名)1 小时前
为什么 ThreadLocalMap 的 key 是弱引用 value是强引用
java·jvm·算法
多多*1 小时前
Java设计模式 简单工厂模式 工厂方法模式 抽象工厂模式 模版工厂模式 模式对比
java·linux·运维·服务器·stm32·单片机·嵌入式硬件
qq. 28040339842 小时前
CSS层叠顺序
前端·css
喝拿铁写前端2 小时前
SmartField AI:让每个字段都找到归属!
前端·算法
猫猫不是喵喵.2 小时前
vue 路由
前端·javascript·vue.js
Guarding and trust3 小时前
python系统之综合案例:用python打造智能诗词生成助手
服务器·数据库·python
烛阴3 小时前
JavaScript Import/Export:告别混乱,拥抱模块化!
前端·javascript
南鸳6103 小时前
Linux常见操作命令(2)
linux·运维·服务器
bin91533 小时前
DeepSeek 助力 Vue3 开发:打造丝滑的表格(Table)之添加行拖拽排序功能示例12,TableView16_12 拖拽动画示例
前端·javascript·vue.js·ecmascript·deepseek