activity流程引擎删除数据

背景:
因为垃圾数据太大,导致流程引擎查询待办查询超过3S,用户取消的数据也需要进行硬删除,减少流程引擎数据占用,加快查询速度

删除流程引擎数据相关表:
–查询已有工作流数据

select * from act_evt_log where proc_inst_id_ = '实例id';

select * from act_hi_actinst where proc_inst_id_ = '实例id';

select * from act_hi_attachment where proc_inst_id_ = '实例id';

select * from act_hi_comment where proc_inst_id_ = '实例id';

select * from act_hi_detail where proc_inst_id_ = '实例id';

select * from act_hi_identitylink where proc_inst_id_ = '实例id';

select * from act_hi_procinst where proc_inst_id_ = '实例id';

select * from act_hi_taskinst where proc_inst_id_ = '实例id';

select * from act_hi_varinst where proc_inst_id_ = '实例id';

select * from act_ru_event_subscr where proc_inst_id_ = '实例id';

select * from act_ru_execution where proc_inst_id_ = '实例id';

select * from act_ru_identitylink where proc_inst_id_ = '实例id';

select * from act_ru_task where proc_inst_id_ = '实例id';

select * from act_ru_variable where proc_inst_id_ = '实例id';

因为数据量太大,只能输入proc_inst_id_ 跑代码来进行删除
代码如下:

    @Autowired
    private RuntimeService runtimeService;
    @Autowired
    private HistoryService historyService;

// 执行此方法后未审批的任务 act_ru_task 会被删除,流程历史 act_hi_taskinst 不会被删除,并且流程历史的状态为finished完成
 runtimeService.deleteProcessInstance(id, "用户撤销");
 //删除流程历史信息 该接口流程数据会直接硬删除,包括历史数据,调用请慎重
 historyService.deleteHistoricProcessInstance(id);

引用:
Activiti;如何删除工作流/流程引擎 act_hi_procinst 错误实例数据 proc_inst_id_
activiti 撤销

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值