Flowable工作流之查询历史流程信息

本文介绍了如何查询Flowable工作流的历史流程信息,包括历史流程实例、历史活动、历史任务和历史流程变量。通过示例展示了从相应的历史表中获取数据的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 前言

上篇文章 和大家分享的流程操作主要是正在执行的流程,我们有一个非常常见的场景是查询执行过的流程信息,在上篇文章中,小伙伴们已经知道,对于正在执行的流程,会在 act_ru_execution 表中保存一条对应的记录,不过流程执行结束之后,act_ru_execution 表中的记录会被删除掉,此时要是想查询已经执行过的流程信息,去哪里查询呢?今天我们就来看看 HistoryService 的使用

本文使用的流程图依然是上篇文章中使用过的,如下

在这里插入图片描述

<?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="MyLeave" name="MyLeave" isExecutable="true">
        <documentation>员工请假流程</documentation>
        <startEvent id="sid-159DD77D-9878-4288-AC29-B898E08DC216" flowable:formFieldValidation="true"></startEvent>
        <userTask id="zgID" name="主管审批" flowable:assignee="张主管" flowable:formFieldValidation="true">
            <extensionElements>
                <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
                    <![CDATA[false]]></modeler:initiator-can-complete>
            </extensionElements>
        </userTask>
        <sequenceFlow id="sid-1E8F84D7-6C11-4D88-84C9-B818474F880E" sourceRef="sid-159DD77D-9878-4288-AC29-B898E08DC216"
                      targetRef="zgID"></sequenceFlow>
        <exclusiveGateway id="sid-A6E285DA-5C65-4BA7-8BB4-5F4D97AC12E0"></exclusiveGateway>
        <sequenceFlow id="sid-08020782-2DDE-4C56-BFC0-224DC99FB50E" sourceRef="zgID"
                      targetRef="sid-A6E285DA-5C65-4BA7-8BB4-5F4D97AC12E0"></sequenceFlow>
        <endEvent id="sid-5BFB0FC6-B2A5-4F6E-9BDB-8785F2883AEB"></endEvent>
        <userTask id="jlID" name="经理审批" flowable:assignee="李经理" flowable:formFieldValidation="true">
            <extensionElements>
                <modeler:initiator-can-complete xmlns:modeler="http://flowable.org/modeler">
                    <![CDATA[false]]></modeler:initiator-can-complete>
            </extensionElements>
        </userTask>
        <exclusiveGateway id="sid-0DA07C30-2930-40F5-A887-FA1C5BF307EF"></exclusiveGateway>
        <sequenceFlow id="sid-833DAA1C-F1C2-41A1-8455-3FAB79893C14" sourceRef="jlID"
                      targetRef="sid-0DA07C30-2930-40F5-A887-FA1C5BF307EF"></sequenceFlow>
        <endEvent id="sid-8941849E-B17F-4848-BFC8-C6B05CC21A9F"></endEvent>
        <endEvent id="sid-3596170A-0E0F-4C07-BD32-F04AFB375EB1"></endEvent>
        <sequenceFlow id="sid-A74937CE-02B1-493B-8033-08CA2D652771" name="同意"
                      sourceRef="sid-A6E285DA-5C65-4BA7-8BB4-5F4D97AC12E0" targetRef="jlID">
            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${executeType=='YES'}]]></conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="sid-BE2005E1-26F7-4E42-8AC2-7C4F25274F1A" name="同意"
                      sourceRef="sid-0DA07C30-2930-40F5-A887-FA1C5BF307EF"
                      targetRef="sid-3596170A-0E0F-4C07-BD32-F04AFB375EB1">
            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${executeType=='YES'}]]></conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="sid-67F146AA-C9F5-4A21-AF26-A77A349D80B7" name="拒绝"
                      sourceRef="sid-A6E285DA-5C65-4BA7-8BB4-5F4D97AC12E0"
                      targetRef="sid-5BFB0FC6-B2A5-4F6E-9BDB-8785F2883AEB">
            
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值