前言
流程结束
备份表数据
注意:做这个操作的时候因为要对表做update,delete 请谨慎操作,一定要加对条件防止出现全表update或者delete 。可能的话最好先对相关表做备份:备份语句create table 备份表名 as select * from 需要备份的表名。
备份表语句如下:
/*dialect*/create table t_wfr_actinstbak20191231 as select * from t_wfr_actinst
/*dialect*/create table t_wfr_procinstbak20191231 as select * from t_wfr_procinst
/*dialect*/create table t_wfr_runtime20191231 as select * from t_wfr_runtime
--1.根据流程编码查询对应的流程实例id
select fprocinstid from t_wfr_procinst where fcode = 'FYSQDSPLC_2491056';
--a276b9df-cf9f-419f-bad7-c17d69f244a4WFPCINST——>流程实例id
--2.删除流程运行期数据t_wfr_runtime
delete from t_wfr_runtime where fprocinstid = '流程实例id';
--3.查询活动节点,按照降序排列
select * from t_wfr_actinst where fprocinstid = '流程实例id' order by fcreatedtime desc;
--4.修改最后一个活动节点的状态为已完成,以及后续节点为提交节点活动id
update T_WFR_ACTINST set fstate='closed.completed',FTOACTINSTLIST ='提交节点活动id',FPOSTACTINSTLIST ='提交节点活动id' where factinstid='最后一个活动实例id';
--5.修改提交节点状态为未开始,后续节点id为空
update T_WFR_ACTINST set fstate='open.not_running.not_started',FTOACTINSTLIST ='',FPOSTACTINSTLIST ='' where factinstid='提交节点id';
--6.修改流程实例状态为运行中
update t_wfr_procinst set fstate = 'open.running' where fprocinstid = '流程实例id';
--7.如果当前流程已经正常结束,经过了结束节点的话。需要将对应的结束节点的活动信息删除,如下图
delete from t_wfr_actinst where FACTINSTID = '结束节点的活动id';
--8.清除缓存,界面跳转
打开流程引擎日志界面,按快捷键ctrl+shift+T,在弹出界面中选择clearChche ,选中后点击确定。就清除了缓存。然后去流程监控做跳转。如下图