標籤:
一: 曆史資料表11. JBPM4_HIST_ACTINST 流程活動(節點)執行個體表 存放Activity Instance的記錄12. JBPM4_HIST_DETAIL 流程曆史詳細表 儲存Variable的變更記錄13. JBPM4_HIST_PROCINST 流程執行個體曆史表 存放Process Instance的曆史資訊14. JBPM4_HIST_TASK 流程任務執行個體曆史表 Task的曆史資訊。15. JBPM4_HIST_VAR 流程變數(上下文)曆史表 儲存曆史的變數 若:在流程最後一步,發起人提交處長後,處長在審核同意操作後,工作流程已執行完,但,業務表沒有同步更新:本次記錄限於:處長 在流程審核最後操作時,執行同意流程時:
--子表,procinst外鍵
delete from JBPM4_HIST_DETAIL where hproci_=‘13433593‘;
--子表,procinst外鍵
delete from JBPM4_HIST_ACTINST where execution_=‘JbpmCheckFlowVersionThi.13433593‘ ;
--主表,BDid主鍵
delete from JBPM4_HIST_PROCINST where dbid_ = 13433593 ;
delete from jbpm4_hist_task where dbid_ = 13364559 ;
--工作流程業務表
insert into jbpm4_execution (dbid_, class_, dbversion_, activityname_, procdefid_, hasvars_, name_, key_, id_, state_, susphiststate_, priority_, hisactinst_, parent_, instance_, superexec_, subprocinst_, parent_idx_) values (13433593, ‘pvm‘, 114, ‘處長崗‘, ‘JbpmCheckFlowVersionThi-3133‘, 1, null, null, ‘JbpmCheckFlowVersionThi.13433593‘, ‘active-root‘, null, 0, 13364560, null, 13433593, null, null, null);
insert into jbpm4_task (dbid_, class_, dbversion_, name_, descr_, state_, susphiststate_, assignee_, form_, priority_, create_, duedate_, progress_, signalling_, execution_id_, activity_name_, hasvars_, supertask_, execution_, procinst_, swimlane_, taskdefname_) values (13364559, ‘T ‘, 1, ‘處長崗‘, null, ‘open‘, null, ‘directorV1.3‘, null, 0, TO_DATE(‘2016-03-22 15:54:05‘, ‘%Y-%m-%d %H:%M:%S‘), null, null, 1, ‘JbpmCheckFlowVersionThi.13433593‘, ‘處長崗‘, 0, null, 13433593, 13433593, null, ‘處長崗‘);
insert into JBPM4_VARIABLE (dbid_, class_, dbversion_, key_, converter_, hist_, execution_, task_, lob_, date_value_, double_value_, classname_, long_value_, string_value_, text_value_, exesys_) values (13433593, ‘string‘, 0, ‘opinion‘, null, 0, 13433593, null, null, null, null, null, null, ‘YES‘, null, null);
主子表關係:
JBPM4_HIST_PROCINST這張表,因為JBPM4_HIST_ACTINST表的HPROCI_欄位是關聯JBPM4_HIST_PROCINST表的DBID_欄位,如果JBPM4_HIST_PROCINST不存在就會報 table or view not exist. (表或視圖不存在)
關聯:ACTINST.hproci_ = PROCINST.dbid_(主鍵);子表:JBPM4_HIST_ACTINST ;主表:JBPM4_HIST_PROCINST ;--------------------------------------------------------------------------------------------------------------------------------------補數表:jbpm4_execution;jbpm4_task;JBPM4_VARIABLE;補數原則:按照如下順序;select * from jbpm4_execution where dbid_ =‘13433593‘;// dbid= reinsbpmMain.taskid;select * from jbpm4_task where dbid_=‘13364559‘;// 原則上為hist_task.taskid,約束JBPM4_HIST_ACTINST表的htask_
select * from JBPM4_VARIABLE where dbid_=‘13433593‘;// dbid= reinsbpmMain.taskid;
dbid= reinsbpmMain.taskid;
刪除表:按照如下順序; delete from JBPM4_HIST_ACTINST where dbid_ in (13364560,13354970) ;
delete from JBPM4_HIST_PROCINST where dbid_ = 13433593 ;
delete from jbpm4_hist_task where dbid_ = 13364559 ;
關聯量表:
select * from jbpm4_hist_task where execution_ = ‘JbpmCheckFlowVersionThi.13433593‘ ; //若 hist_actinst表中,
select * from JBPM4_HIST_ACTINST where execution_=‘JbpmCheckFlowVersionThi.13433593‘ ; //刪除處長審批,即 最後一條資料!註:需注意兩者約束!
如上分析:若hist_actinst表中,處長審批節點中,htask欄位可留值(即hist_task中會有一條dbid_為9092064的資料),這樣,在執行時,只會更新9092064其時間,不會重新插入時間! 第二:流程執行個體表 補數原則,基於!jbpm4_execution 流程執行個體表:以JBPM4_HIST_ACTINST表記錄為依據 進行補數!select * from jbpm4_execution where dbid_ =‘13433989‘;//id=ACTINST.dbid_; select * from jbpm4_task where dbid_=‘13364561‘;//ACTINST.htask_
select * from JBPM4_VARIABLE where dbid_=‘13433989‘;//同上!
補數時,一定確保如上所提表中資料完整,確保在其約束下可驗證流程id一致性!
Jbpm工作流程表補數記錄