首先,在jbpm4中,流程定义相关的部署信息就存在JBPM4_DEPLOYMENT、JBPM4_DEPLOYPROP及JBPM4_LOB (存放当发布一个png和xml文件后的流程定义后的记录)。中。
JBPM4_HIST_PROCINST、JBPM4_HIST_ACTINST两张表中,分别存放的是process Instance、Activity Instance的历史记录,Activity Instance是指流程定义中各个步骤:task descition等存放Process Instance、Activity Instance历史记录的表有了,那他们的当前记录存在什么地方呢?这就需要弄清楚jBPM的另外几个概念。一般而言,在jBPM中,“a process instance is the root of a tree of executions”。因此,当一个流程实例Split出两个并行步骤的时候,在JBPM4_EXECUTION表中将有三笔相关记录,一笔是代表流程实例的Root Execution,另外两笔是关于上述两个并行步骤的Child Execution。
此外,在jbpm中,Activity的种类是很丰富的,可以是Control Flow Activities,如sub-process,decision等,也可以是Automatic Activity,如java、script、sql等,其中需要人来参与完成的Activity被称为Task,待办任务放在JBPM4_TASK表中,而历史任务放在JBPM4_HIST_TASK表中。
对一个Task而言,它可能会有多个Participation(swim lane 同样会有多个Participation),Participation的种类有Candidate、client、owner、Replaced Assignee和viewer,而具体的Participation既可以是单一用户,也可以是用户组,Participation的信息存放在JBPM4_PARTICIPATION中。
Swim Lane是一种Runtime Process Role,通过Swim Lane,多个Task可以一次分配到同一Actor身上,存放这些信息是表JBPM4_PARTICIPATION。
JBPM4_ID_GROUP、JBPM4_ID_MEMBERSHIP、JBPM4_ID_USER这是基本的权限控制,建议关于用户认证方面还是自己开发一套,这个功能太简单了,难以满足需求。
JBPM4_JOB存放的是Timer的定义。
JBPM4_PROPERTY这是jbpm引擎参数表。
JBPM4_VAR表存放流程临时变量,当流程实例结束后,表中内容清除。
JBPM4_HIST_VAR表存放历史临时变量,但是jbpm4好像还没有对这张表进行利用。
JBPM4_HIST_DETAIL表保存变量变更记录。
了解jbpm4.3以上这18张表后,我们应该在流程运行中,详细观察jbpm是如何对这些表进行操作,以及进行什么样的操作的。
发布一个流程定义后:
JBPM4_DEPLOYMENT新增一条记录
JBPM4_DEPLOYPROP新增三条记录
JBPM4_LOB新增两条记录
HQL代码如下
Hibernate: update JBPM4_PROPERTY set VERSION_=?, VALUE_=? where KEY_=? and VERSION_=?
Hibernate: select lob_.DBID_, lob_.DBVERSION_ as DBVERSION2_7_, lob_.BLOB_VALUE_ as BLOB3_7_ from JBPM4_LOB lob_ where lob_.DBID_=?
Hibernate: insert into JBPM4_DEPLOYMENT (NAME_, TIMESTAMP_, STATE_, DBID_) values (?, ?, ?, ?)
Hibernate: insert into JBPM4_LOB (DBVERSION_, BLOB_VALUE_, DBID_) values (?, ?, ?)
Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?
Hibernate: update JBPM4_LOB set DEPLOYMENT_=?, NAME_=? where DBID_=?
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?
Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment1_.OBJNAME_='leave'
Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='leave'
Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.STRINGVAL_='leave' order by deployment3_.LONGVAL_ desc limit ?
Hibernate: select deployment1_.OBJNAME_ as col_0_0_, deployment1_.DEPLOYMENT_ as col_1_0_ from JBPM4_DEPLOYMENT deployment0_, JBPM4_DEPLOYPROP deployment1_, JBPM4_DEPLOYPROP deployment2_, JBPM4_DEPLOYPROP deployment3_ where deployment1_.KEY_='pdid' and deployment1_.DEPLOYMENT_=deployment0_.DBID_ and deployment2_.KEY_='pdkey' and deployment2_.OBJNAME_=deployment1_.OBJNAME_ and deployment2_.DEPLOYMENT_=deployment0_.DBID_ and deployment3_.KEY_='pdversion' and deployment3_.OBJNAME_=deployment1_.OBJNAME_ and deployment3_.DEPLOYMENT_=deployment0_.DBID_ and deployment1_.STRINGVAL_='leave-1'
Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into JBPM4_DEPLOYPROP (DEPLOYMENT_, OBJNAME_, KEY_, STRINGVAL_, LONGVAL_, DBID_) values (?, ?, ?, ?, ?, ?)
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=?, OBJNAME_=?, KEY_=?, STRINGVAL_=?, LONGVAL_=? where DBID_=?
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?
Hibernate: update JBPM4_DEPLOYPROP set DEPLOYMENT_=? where DBID_=?
开始一个流程startProcessInstanceByKey后:
JBPM4_EXECUTION新增一条记录
JBPM4_TASK新增一条记录
JBPM4_HIST_PROCINST、JBPM4_HIST_ACTINST分别新增一条记录
JBPM4_HIST_TASK新增一条记录
当completeTask的时候也会生成若干HQL
一起提示的HQL 如下 :
Hibernate: update JBPM4_PROPERTY set VERSION_=?, VALUE_=? where KEY_=? and VERSION_=?
Hibernate: select historytas_.DBID_, historytas_.DBVERSION_ as DBVERSION2_11_, historytas_.EXECUTION_ as EXECUTION3_11_, historytas_.OUTCOME_ as OUTCOME4_11_, historytas_.ASSIGNEE_ as ASSIGNEE5_11_, historytas_.PRIORITY_ as PRIORITY6_11_, historytas_.STATE_ as STATE7_11_, historytas_.CREATE_ as CREATE8_11_, historytas_.END_ as END9_11_, historytas_.DURATION_ as DURATION10_11_, historytas_.NEXTIDX_ as NEXTIDX11_11_ from JBPM4_HIST_TASK historytas_ where historytas_.DBID_=?
请假单已填写:true
Hibernate: select stringvari_.DBID_, stringvari_.DBVERSION_ as DBVERSION3_6_, stringvari_.KEY_ as KEY4_6_, stringvari_.CONVERTER_ as CONVERTER5_6_, stringvari_.HIST_ as HIST6_6_, stringvari_.EXECUTION_ as EXECUTION7_6_, stringvari_.TASK_ as TASK8_6_, stringvari_.STRING_VALUE_ as STRING14_6_ from JBPM4_VARIABLE stringvari_ where stringvari_.DBID_=?
Hibernate: select stringvari_.DBID_, stringvari_.DBVERSION_ as DBVERSION3_6_, stringvari_.KEY_ as KEY4_6_, stringvari_.CONVERTER_ as CONVERTER5_6_, stringvari_.HIST_ as HIST6_6_, stringvari_.EXECUTION_ as EXECUTION7_6_, stringvari_.TASK_ as TASK8_6_, stringvari_.STRING_VALUE_ as STRING14_6_ from JBPM4_VARIABLE stringvari_ where stringvari_.DBID_=?
Hibernate: select stringvari_.DBID_, stringvari_.DBVERSION_ as DBVERSION3_6_, stringvari_.KEY_ as KEY4_6_, stringvari_.CONVERTER_ as CONVERTER5_6_, stringvari_.HIST_ as HIST6_6_, stringvari_.EXECUTION_ as EXECUTION7_6_, stringvari_.TASK_ as TASK8_6_, stringvari_.STRING_VALUE_ as STRING14_6_ from JBPM4_VARIABLE stringvari_ where stringvari_.DBID_=?
Hibernate: insert into JBPM4_EXECUTION (DBVERSION_, ACTIVITYNAME_, PROCDEFID_, HASVARS_, NAME_, KEY_, ID_, STATE_, SUSPHISTSTATE_, PRIORITY_, HISACTINST_, PARENT_, INSTANCE_, SUPEREXEC_, SUBPROCINST_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'pvm', ?)
Hibernate: insert into JBPM4_HIST_PROCINST (DBVERSION_, ID_, PROCDEFID_, KEY_, START_, END_, DURATION_, STATE_, ENDACTIVITY_, NEXTIDX_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into JBPM4_TASK (DBVERSION_, NAME_, DESCR_, STATE_, SUSPHISTSTATE_, ASSIGNEE_, FORM_, PRIORITY_, CREATE_, DUEDATE_, PROGRESS_, SIGNALLING_, EXECUTION_ID_, ACTIVITY_NAME_, HASVARS_, SUPERTASK_, EXECUTION_, PROCINST_, SWIMLANE_, TASKDEFNAME_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', ?)
Hibernate: insert into JBPM4_HIST_TASK (DBVERSION_, EXECUTION_, OUTCOME_, ASSIGNEE_, PRIORITY_, STATE_, CREATE_, END_, DURATION_, NEXTIDX_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into JBPM4_HIST_ACTINST (DBVERSION_, HPROCI_, TYPE_, EXECUTION_, ACTIVITY_NAME_, START_, END_, DURATION_, TRANSITION_, NEXTIDX_, HTASK_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'task', ?)
Hibernate: insert into JBPM4_VARIABLE (DBVERSION_, KEY_, CONVERTER_, HIST_, EXECUTION_, TASK_, STRING_VALUE_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, 'string', ?)
Hibernate: insert into JBPM4_VARIABLE (DBVERSION_, KEY_, CONVERTER_, HIST_, EXECUTION_, TASK_, STRING_VALUE_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, 'string', ?)
Hibernate: insert into JBPM4_VARIABLE (DBVERSION_, KEY_, CONVERTER_, HIST_, EXECUTION_, TASK_, STRING_VALUE_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, 'string', ?)
Hibernate: update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?
Hibernate: update JBPM4_TASK set DBVERSION_=?, NAME_=?, DESCR_=?, STATE_=?, SUSPHISTSTATE_=?, ASSIGNEE_=?, FORM_=?, PRIORITY_=?, CREATE_=?, DUEDATE_=?, PROGRESS_=?, SIGNALLING_=?, EXECUTION_ID_=?, ACTIVITY_NAME_=?, HASVARS_=?, SUPERTASK_=?, EXECUTION_=?, PROCINST_=?, SWIMLANE_=?, TASKDEFNAME_=? where DBID_=? and DBVERSION_=?
Hibernate: update JBPM4_VARIABLE set EXECUTION_=?, KEY_=? where DBID_=?
Hibernate: update JBPM4_VARIABLE set EXECUTION_=?, KEY_=? where DBID_=?
Hibernate: update JBPM4_VARIABLE set EXECUTION_=?, KEY_=? where DBID_=?
Hibernate: select taskimpl0_.DBID_ as DBID1_14_, taskimpl0_.DBVERSION_ as DBVERSION3_14_, taskimpl0_.NAME_ as NAME4_14_, taskimpl0_.DESCR_ as DESCR5_14_, taskimpl0_.STATE_ as STATE6_14_, taskimpl0_.SUSPHISTSTATE_ as SUSPHIST7_14_, taskimpl0_.ASSIGNEE_ as ASSIGNEE8_14_, taskimpl0_.FORM_ as FORM9_14_, taskimpl0_.PRIORITY_ as PRIORITY10_14_, taskimpl0_.CREATE_ as CREATE11_14_, taskimpl0_.DUEDATE_ as DUEDATE12_14_, taskimpl0_.PROGRESS_ as PROGRESS13_14_, taskimpl0_.SIGNALLING_ as SIGNALLING14_14_, taskimpl0_.EXECUTION_ID_ as EXECUTION15_14_, taskimpl0_.ACTIVITY_NAME_ as ACTIVITY16_14_, taskimpl0_.HASVARS_ as HASVARS17_14_, taskimpl0_.SUPERTASK_ as SUPERTASK18_14_, taskimpl0_.EXECUTION_ as EXECUTION19_14_, taskimpl0_.PROCINST_ as PROCINST20_14_, taskimpl0_.SWIMLANE_ as SWIMLANE21_14_, taskimpl0_.TASKDEFNAME_ as TASKDEF22_14_ from JBPM4_TASK taskimpl0_ where taskimpl0_.ASSIGNEE_=? order by taskimpl0_.PRIORITY_ desc
Hibernate: select taskimpl0_.DBID_ as DBID1_14_, taskimpl0_.DBVERSION_ as DBVERSION3_14_, taskimpl0_.NAME_ as NAME4_14_, taskimpl0_.DESCR_ as DESCR5_14_, taskimpl0_.STATE_ as STATE6_14_, taskimpl0_.SUSPHISTSTATE_ as SUSPHIST7_14_, taskimpl0_.ASSIGNEE_ as ASSIGNEE8_14_, taskimpl0_.FORM_ as FORM9_14_, taskimpl0_.PRIORITY_ as PRIORITY10_14_, taskimpl0_.CREATE_ as CREATE11_14_, taskimpl0_.DUEDATE_ as DUEDATE12_14_, taskimpl0_.PROGRESS_ as PROGRESS13_14_, taskimpl0_.SIGNALLING_ as SIGNALLING14_14_, taskimpl0_.EXECUTION_ID_ as EXECUTION15_14_, taskimpl0_.ACTIVITY_NAME_ as ACTIVITY16_14_, taskimpl0_.HASVARS_ as HASVARS17_14_, taskimpl0_.SUPERTASK_ as SUPERTASK18_14_, taskimpl0_.EXECUTION_ as EXECUTION19_14_, taskimpl0_.PROCINST_ as PROCINST20_14_, taskimpl0_.SWIMLANE_ as SWIMLANE21_14_, taskimpl0_.TASKDEFNAME_ as TASKDEF22_14_ from JBPM4_TASK taskimpl0_ where taskimpl0_.EXECUTION_=?
Hibernate: select historytas_.DBID_, historytas_.DBVERSION_ as DBVERSION2_11_, historytas_.EXECUTION_ as EXECUTION3_11_, historytas_.OUTCOME_ as OUTCOME4_11_, historytas_.ASSIGNEE_ as ASSIGNEE5_11_, historytas_.PRIORITY_ as PRIORITY6_11_, historytas_.STATE_ as STATE7_11_, historytas_.CREATE_ as CREATE8_11_, historytas_.END_ as END9_11_, historytas_.DURATION_ as DURATION10_11_, historytas_.NEXTIDX_ as NEXTIDX11_11_ from JBPM4_HIST_TASK historytas_ where historytas_.DBID_=?
Hibernate: select leave0_.leave_id as leave1_0_0_, leave0_.user_id as user2_0_0_, leave0_.day as day0_0_, leave0_.apply_time as apply4_0_0_, leave0_.status as status0_0_, leave0_.content as content0_0_ from leavedb.leave_ leave0_ where leave0_.leave_id=?
Hibernate: select user0_.user_id as user1_1_0_, user0_.user_name as user2_1_0_, user0_.login_name as login3_1_0_, user0_.password as password1_0_, user0_.position as position1_0_ from leavedb.user_ user0_ where user0_.user_id=?
Hibernate: insert into JBPM4_HIST_ACTINST (DBVERSION_, HPROCI_, TYPE_, EXECUTION_, ACTIVITY_NAME_, START_, END_, DURATION_, TRANSITION_, NEXTIDX_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'excl', ?)
Hibernate: insert into JBPM4_TASK (DBVERSION_, NAME_, DESCR_, STATE_, SUSPHISTSTATE_, ASSIGNEE_, FORM_, PRIORITY_, CREATE_, DUEDATE_, PROGRESS_, SIGNALLING_, EXECUTION_ID_, ACTIVITY_NAME_, HASVARS_, SUPERTASK_, EXECUTION_, PROCINST_, SWIMLANE_, TASKDEFNAME_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', ?)
Hibernate: insert into JBPM4_HIST_TASK (DBVERSION_, EXECUTION_, OUTCOME_, ASSIGNEE_, PRIORITY_, STATE_, CREATE_, END_, DURATION_, NEXTIDX_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into JBPM4_HIST_ACTINST (DBVERSION_, HPROCI_, TYPE_, EXECUTION_, ACTIVITY_NAME_, START_, END_, DURATION_, TRANSITION_, NEXTIDX_, HTASK_, CLASS_, DBID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'task', ?)
Hibernate: update JBPM4_EXECUTION set DBVERSION_=?, ACTIVITYNAME_=?, PROCDEFID_=?, HASVARS_=?, NAME_=?, KEY_=?, ID_=?, STATE_=?, SUSPHISTSTATE_=?, PRIORITY_=?, HISACTINST_=?, PARENT_=?, INSTANCE_=?, SUPEREXEC_=?, SUBPROCINST_=? where DBID_=? and DBVERSION_=?
Hibernate: update JBPM4_HIST_ACTINST set DBVERSION_=?, HPROCI_=?, TYPE_=?, EXECUTION_=?, ACTIVITY_NAME_=?, START_=?, END_=?, DURATION_=?, TRANSITION_=?, NEXTIDX_=?, HTASK_=? where DBID_=? and DBVERSION_=?
Hibernate: update JBPM4_HIST_TASK set DBVERSION_=?, EXECUTION_=?, OUTCOME_=?, ASSIGNEE_=?, PRIORITY_=?, STATE_=?, CREATE_=?, END_=?, DURATION_=?, NEXTIDX_=? where DBID_=? and DBVERSION_=?
Hibernate: update JBPM4_TASK set DBVERSION_=?, NAME_=?, DESCR_=?, STATE_=?, SUSPHISTSTATE_=?, ASSIGNEE_=?, FORM_=?, PRIORITY_=?, CREATE_=?, DUEDATE_=?, PROGRESS_=?, SIGNALLING_=?, EXECUTION_ID_=?, ACTIVITY_NAME_=?, HASVARS_=?, SUPERTASK_=?, EXECUTION_=?, PROCINST_=?, SWIMLANE_=?, TASKDEFNAME_=? where DBID_=? and DBVERSION_=?
Hibernate: update leavedb.leave_ set user_id=?, day=?, apply_time=?, status=?, content=? where leave_id=?
Hibernate: delete from JBPM4_TASK where DBID_=? and DBVERSION_=?
查看数据库后会发现
JBPM4_DEPLOYMENT(流程定义的部署记录)
JBPM4_DEPLOYPROP(已部署的流程定义的具体属性)
JBPM4_LOB (流程定义的相关资源)
包括 JPDL_XML ,图片, 用户代码 JAVA 类等。以二进制的格式统一存储在此表中。
JBPM4_JOB (异步活动或定时执行的JOB记录)
JBPM4_VARIABLE(流程实例的变量)
JBPM4_SWIMLANE(任务泳道,属于流程定义的数据)
JBPM4_PARTICIPATION(任务参与者)
区别于任务的分配人,属于流程实例的数据
JBPM4_PROPERTY(引擎参数)
记录JBPM的一些引擎参数
会保存一些初始设定的种子数据
例如引擎版本(KEY=db.version) ,ID生成器版本(KEY=next.dbid)
KEY:引擎KEY 比如next.dbid 下次执行的DBID_
VERSION:版本号
VALUE:对应的引擎KEY的VALUE
JBPM4_EXECUTION(流程实例及执行对象)
这个表的字段大概记录了以下内容分别代表的意思是
DBID_ :自动生成 (细心的我发现,原来这个字段之前是有在JBPM4_PROPERTY里面预生成了的。里面的NEXDB.ID的值就是下次我们会生成的ID)
CLASS_:PVM 代表是通过什么机制来执行的
DBVERSION_:版本。同DBID 也是之前就预生成了的
ACTIVITYNAME_: 待处理任务的名称 也是对应XML里面 对应节点的NAME
PROCDEFID_:流程定义ID 一般是 流程KEY 加版本号
HASVARS_:是否带有参数
NAME_: 暂时还不知道 搞啥子的 =。= 我看到的数据都是NULL
KEY_:流程实例ID (比如请假表的ID )
ID_:一般是流程实例对应的KEY+对应的业务ID 比如 leave.8a8a8af12e74adb0012e74c6a4b70001
STATE_:记录状态 比如active-root
PRIORITY_:优先级 暂时没研究=。=
HISACTINST:对应的 JBPM4_HIST_ACTINST 表里的ID
INSTANCE:对应 实例ID
SUPEREXEC: 不知道干什么的=。=
SUBPROCINST:分支实例
PARENT_IDX:父节点实例
我们在上面的HQL里会发现 在往 JBPM4_EXECUTION 表里插入值以后 又往JBPM4_HIST_PROCINST 表里插入了一条记录作为历史记录 这个时候我们来研究下 JBPM4_HIST_PROCINST 这个表表结构
JBPM4_HIST_PROCINST
DBID_:和上面的EXECUTION表里的DBID_对应
DBVERSION:这个里面的值和上面的EXECUTION里的DBVERSION有少些区别 (作者现在刚发起一个申请流程上面的EXECUTION里的DBVERSION为2, HIST_PROCINST里的为0)
ID_:同上的EXECUTION表里的 ID_为 流程实例对应的KEY+对应的业务ID 比 leave.8a8a8af12e74adb0012e74c6a4b70001
PROCDEFID:同上的 EXECUTION里的
KEY:流程实例ID
START_:流程实例发起时间
END_:流程实例结束时间
DURATION_:字面上的理解是 流程实例持续时间
STATE:记录流程实例的状态 如:active
ENDACTIVITY_:结束动作对应的NAME
NEXTIDX_:下一个。。。。? 还没研究出来到底是干嘛的 =。=
OK 这个表插入完后,我们看代码的标记9:
可以发现原来现在开始进入TASK 人工任务了 往JBPM4_TASK 开始插入数据了 那我们就开始研究JBPM4_TASK 这个表
JBPM4_TASK (流程实例的任务记录)
DBID_:不懂这里为什么还叫这个 反正跟前面两个表的DBID_ 值是不一样的。
CLASS:任务对应的POJI类 如无特殊指向 就T 类似于 泛型里的?
DBVERSION:对应的版本号
NAME_:对应XML TASK里的NAME
DESCR_:描述字段
STATE_:代表任务的状态 具体在这里起什么作用还不知道=。= 就作者现在的表里字段的值是OPEN
ASSIGNEE_:任务托付者 这个字段很关键 表示这个任务托付给谁来执行了。
FORM_:对应XML 里的TASK FORM属性
PRIORITY:优先权 暂时还没搞清楚这里是干嘛用的=。=
CREATE_:人工任务开始时间
DUEDATE_:人工任务销毁时间 或者 完成时间
PROGRESS_:进程 但是具体怎么弄,怎么起作用还没研究
SIGNALLING: 字面理解 信号传输法 研究中=。= 作者这里的值为1 先做个标记
EXECUTION_ID_:外键关键 EXECUTION表里的ID_
ACTIVITY_NAME_:活动的NAME 对应XML里的NAME
HASVARS_:是否有参数
SUPER_TASK:。。。。这个=。=
EXECUTION_:对应EXECUTION表里的DBID字段 感觉有点冗余
PROCINST_:对应一个流程实例ID
SWIMLANE_:对应泳道ID
TASKDEFNAME:任务定义名称 默认和TASK NAME 一样
J
当执行taskService.setVariables(task.getId(), map);时,JBPM4_VARIABLES中添加变量记录