误删万户ezflow流程后,想办法恢复,测试环境恢复备份的数据库。
1)测试环流程所属组表 ez_bpmpool_process
select * from ez_bpmpool_process where pool_process_name like '%零星%'
找到对应记录插入正式环境
insert into ez_bpmpool_process (pool_process_id, pool_process_type, pool_process_name,
pool_ezflowprocess_key,pool_ezflowprocess_defid,
pool_ezflowprocess_formkey,pool_process_formid,pool_process_createtime,
pool_process_sort,pool_moduleid,
pool_formtype,pool_create_userid,pool_create_orgid,phonestatus,ipadstatus)VALUES
(3807788,1,'零星维修申请流程.ezfolw','XZWXSQLC','XZWXSQLC:9:14462921','XZWXSQB',3807492, to_date('2017-5-10', 'yyyy-MM-dd'),1,1,0,1183893,8010,1,1)
2)测试环境流程定义表 ez_flow_de_designer
select * from ez_flow_de_designer where processname like '%零星%'
要注意流程定义字段是blod需要通过程序插入,将流程定义写到xml中,程序运行时读取插入。
static void Main(string[] args)
{
FileStream fs = File.OpenRead("flow.xml");
StreamReader sr = new StreamReader(fs);
string value = sr.ReadToEnd();
sr.Close();
fs.Close();
OracleParameter param = new OracleParameter();
param.OracleType = OracleType.NClob;
param.Value = value;
param.ParameterName = "flowdata";
try
{
DbHelperOra.ExecuteSql(@"insert into ez_flow_de_designer (id,processid,processname,designerxml,process_scopeids,process_scopenames,createuserid,createusername, sort,is_deployed,domainid,createorgid,createtime,formcode,
mobile_status, mobile_phone_status, sub_type, formtype, processtype)
values(4697223, 'XZWXSQLC', '零星维修申请流程.ezfolw',:flowdata,
'*10000**南京xxxxx有限公司*', '南京xxxxx有限公司,', 1183893, 'xxx', 1, 1, 0, 8010, to_date('2017/5/10','yyyy-MM-dd'), 'XZWXSQB', 1, 1, 0, 0, 1)", param);
}catch(Exception ex)
{
Console.Write(ex.Message);
}
Console.ReadLine();
}
3)测试环境流程表单关系表
select * from ez_flow_de_desigform where processid = 'XZWXSQLC'
insert into ez_flow_de_desigform (id_,processid, formcode) values(14462909,'XZWXSQLC','XZWXSQB')
4)流程版本表,无需插入看下即可
select * from ez_flow_re_procdef where id_ = 'XZWXSQLC:9:14462921' order by name_
5)流程版本之流程定义含blob 无需插入
select * from ez_flow_ge_bytearray where name_ = 'XZWXSQLC.bpmn20.xml' and deployment_id_ = 14462919
6)流程节点表 ez_flow_de_activity
select * from ez_flow_de_activity where process_designername = '零星维修申请流程.ezfolw'
insert into ez_flow_de_activity (id, process_designerid,process_designername,process_key, activityid, activityname, formkey,priority,tasksequencetype,
participanttype,condition_type,condition_userids,condition_usernames)values
(14462910, 4697223,'零星维修申请流程.ezfolw','XZWXSQLC','usertask1','部门领导','XZWXSQB',10,'monopolise',
'initiator','DepartLeader','','')
7)流程审批意见表 需要恢复(删除流程后意见也被删除了)需要恢复
select * from ez_flow_re_comment where commentfield = 'whir$t3217_f5718' order by dealtime desc -- recordid = 6652581