activity 根据流程实例ID删除流程实例、删除流程部署
-- 删除流程实例(一定要以下表顺序,否则会报键约束错误)
delete from act_hi_attachment t where t.proc_inst_id_='7626';
delete from act_hi_comment t where t.proc_inst_id_='7626';
delete from act_hi_actinst t where t.proc_inst_id_='7626';
delete from act_hi_detail t where t.proc_inst_id_='7626';
delete from act_hi_identitylink t where t.task_id_ in (
select t.ID_ from act_ru_task t where t.proc_inst_id_='7626'
union all
select t.ID_ from act_hi_taskinst t where t.proc_inst_id_ ='7626'
) or t.proc_inst_id_ ='7626';
delete from act_hi_taskinst t where t.proc_inst_id_='7626';
delete from act_hi_procinst t where t.proc_inst_id_='7626';
delete from act_hi_varinst t where t.proc_inst_id_='7626';
delete from act_ru_event_subscr t where t.proc_inst_id_='7626';
delete from act_ru_identitylink t where t.task_id_ in (
select t.ID_ from act_ru_task t where t.proc_inst_id_='7626'
) or t.proc_inst_id_='7626';
delete from act_ru_variable t where t.proc_inst_id_='7626';
delete from act_ru_task t where t.proc_inst_id_='7626';
delete from act_ru_execution t where t.proc_inst_id_='7626';
-- 删除流程部署
select t.PROC_DEF_ID_ from act_ru_task t where t.proc_inst_id_='7626' ;
select 'delete from act_re_procdef t where t.ID_='''||t.ID_||''';' as sql_str from act_re_procdef t where t.ID_ in ( 'ApexUSMEditOrganizationProcess:1:7506' )
union all
select 'delete from act_ge_bytearray t where t.DEPLOYMENT_ID_='''||t.DEPLOYMENT_ID_||''';' as sql_str from act_re_procdef t where t.ID_ in ( 'ApexUSMEditOrganizationProcess:1:7506' ) ;
union all
select 'delete from act_re_deployment t where t.ID_='''||t.DEPLOYMENT_ID_||''';' as sql_str from act_re_procdef t where t.ID_ in ( 'ApexUSMEditOrganizationProcess:1:7506' ) ;
学问:纸上得来终觉浅,绝知此事要躬行
为事:工欲善其事,必先利其器。
态度:道阻且长,行则将至;行而不辍,未来可期
.....................................................................
------- 桃之夭夭,灼灼其华。之子于归,宜其室家。 ---------------
------- 桃之夭夭,有蕡其实。之子于归,宜其家室。 ---------------
------- 桃之夭夭,其叶蓁蓁。之子于归,宜其家人。 ---------------
=====================================================================
* 博客文章部分截图及内容来自于学习的书本及相应培训课程以及网络其他博客,仅做学习讨论之用,不做商业用途。
* 如有侵权,马上联系我,我立马删除对应链接。 * @author Alan -liu * @Email no008@foxmail.com
转载请标注出处! ✧*꧁一品堂.技术学习笔记꧂*✧. ---> https://www.cnblogs.com/ios9/