activiti删除某个流程对应的实例数据sql

#根据流程key查询所有的流程实例id(历史和运行时)
SELECT
GROUP_CONCAT(t.PROC_INST_ID_) FROM ( SELECT PROC_INST_ID_ FROM ACT_RU_TASK where INSTR(PROC_DEF_ID_,'diagram-03') UNION SELECT PROC_INST_ID_ FROM act_hi_actinst where INSTR(PROC_DEF_ID_,'diagram-03'))t; DELETE FROM act_hi_actinst WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_attachment WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_comment WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_detail WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_identitylink WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_identitylink WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_procinst WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_taskinst WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_hi_varinst WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_ru_event_subscr WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_ru_identitylink WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_ru_identitylink WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_ru_task WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_ru_variable WHERE INSTR('634226,634576',PROC_INST_ID_) ; DELETE FROM act_ru_execution WHERE INSTR('634226,634576',PROC_INST_ID_) ;

 2.流程表结构说明:https://blog.csdn.net/Alaric_L/article/details/123307239

posted @ 2022-12-30 15:34  漂渡  阅读(650)  评论(0编辑  收藏  举报