处理流程已办完,选择一个节点,添加一条待办

Posted 摩西摩西点点

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了处理流程已办完,选择一个节点,添加一条待办相关的知识,希望对你有一定的参考价值。

---找到流程实例id---
select * from ACT_HI_PROCINST t where t.proc_inst_id_ in (select distinct t.proc_inst_id_ from ACT_HI_VARINST t where t.text_=‘402880e8641c8f260164491e12e800f0‘)


---确认记录-----911477
select t.*, t.rowid from ACT_RU_EXECUTION t where t.proc_inst_id_=‘911477‘;

---如果没有,先找最后任务的id----- 如id_为920600
select * from ACT_HI_TASKINST t where t.proc_inst_id_=911477 order by t.start_time_ asc;

----往ACT_RU_EXECUTION插入一条记录,缺少REV_,BUSINESS_KEY_赋值----注意CACHED_ENT_STATE_ 0代表会签加号上的节点,2代表一般,7代表会签的节点
insert into ACT_RU_EXECUTION  (
ID_,PROC_INST_ID_,PROC_DEF_ID_,ACT_ID_,IS_ACTIVE_,IS_CONCURRENT_,IS_SCOPE_,IS_EVENT_SCOPE_,SUSPENSION_STATE_,CACHED_ENT_STATE_
) 
(select 
PROC_INST_ID_,PROC_INST_ID_,PROC_DEF_ID_,TASK_DEF_KEY_,1,0,1,0,1,2 from ACT_HI_TASKINST where ID_=920600);

--BUSINESS_KEY_赋值----
update ACT_RU_EXECUTION set BUSINESS_KEY_=
(
select t0.business_key_ from ACT_HI_PROCINST t0 
where t0.id_=
(
select max(t.id_) from ACT_HI_PROCINST t where t.proc_inst_id_ in (select distinct t.proc_inst_id_ from ACT_HI_VARINST t where t.text_=‘402880e8641c8f260164491e12e800f0‘)
)
) where proc_inst_id_=‘911477‘ and BUSINESS_KEY_ is null;

----REV_赋值--------
update ACT_RU_EXECUTION set REV_=(
select t.rev_ from ACT_RE_PROCDEF t where t.id_=(select t1.proc_def_id_ from ACT_HI_TASKINST t1 where t1.id_=920600))
where proc_inst_id_=‘911477‘ and REV_ is null;

---添加待办-----
insert into ACT_RU_TASK(ID_,EXECUTION_ID_,PROC_INST_ID_,PROC_DEF_ID_,NAME_,PARENT_TASK_ID_,DESCRIPTION_,TASK_DEF_KEY_,OWNER_,ASSIGNEE_,PRIORITY_,CREATE_TIME_,DUE_DATE_,CATEGORY_,TENANT_ID_,FORM_KEY_)  
(select ID_,EXECUTION_ID_,PROC_INST_ID_,PROC_DEF_ID_,NAME_,PARENT_TASK_ID_,DESCRIPTION_,TASK_DEF_KEY_,OWNER_,ASSIGNEE_,PRIORITY_,START_TIME_,DUE_DATE_,CATEGORY_,TENANT_ID_,FORM_KEY_ from ACT_HI_TASKINST where ID_=920600);


--更新ACT_RU_TASK
UPDATE ACT_RU_TASK t0
SET (REV_,SUSPENSION_STATE_) = (
select t.rev_,t.suspension_state_ from ACT_RE_PROCDEF t where t.id_=(select t1.proc_def_id_ from ACT_HI_TASKINST t1 where t1.id_=920600)
) 
where t0.ID_=920600;


--添加待办候选人
insert into ACT_RU_IDENTITYLINK(ID_,GROUP_ID_,TYPE_,USER_ID_,TASK_ID_,PROC_INST_ID_)
(select ID_,GROUP_ID_,TYPE_,USER_ID_,TASK_ID_,PROC_INST_ID_ from ACT_HI_IDENTITYLINK t where t.task_id_=920600);

  

以上是关于处理流程已办完,选择一个节点,添加一条待办的主要内容,如果未能解决你的问题,请参考以下文章

jQuery

android中如何利用view视图添加一条直线

WPF中添加一个Datagrid使用dataset双向绑定,在第一列中添加一列checkbox用来选择本行,

java工作流框架activiti的流程图编辑器如何添加一条Conditional SequenceFlow?

如何直接在sql server中添加一条数据

存根 rspec and_raise 并添加一条消息