流程

如果想要删除部署的流程定义
我们可以直接进行删除
删除的步骤如下:
传递的deployId=”cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd”
1、从流程部署表【ACT_RE_DEPLOYMENT】中根据部署id查询相关信息

  1. select * from ACT_RE_DEPLOYMENT where ID_ = ?
  2. <== Columns: ID_, NAME_, CATEGORY_, KEY_, TENANT_ID_, DEPLOY_TIME_, DERIVED_FROM_, DERIVED_FROM_ROOT_, PARENT_DEPLOYMENT_ID_, ENGINE_VERSION_
  3. <== Row: cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd, name_iwn3ixdj, 请假, null, , 2022-01-17 15:40:51.943, null, null, cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd, null
  4. <== Total: 1

2、从流程定义表【ACT_RE_PROCDEF】中查询相关信息

SELECT RES.* from ACT_RE_PROCDEF RES WHERE RES.DEPLOYMENT_ID_ = ? order by RES.ID_ asc

<==    Columns: ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_, SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_, DERIVED_FROM_, DERIVED_FROM_ROOT_, DERIVED_VERSION_
<==        Row: process_393572ue:5:cbc656e8-7768-11ec-8d5e-00ffaabbccdd, 2, 请假, name_iwn3ixdj, process_393572ue, 5, cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd, name_iwn3ixdj.bpmn, name_iwn3ixdj.process_393572ue.png, null, 0, 1, 1, , null, null, null, 0
<==      Total: 1

3.1、从流程模型信息表【ACT_RE_MODEL】中查询相关信息

SELECT RES.* from ACT_RE_MODEL RES WHERE RES.DEPLOYMENT_ID_ = ? order by RES.ID_ asc

<==      Total: 0

3.2、从流程实例与分支执行表【ACT_RU_EXECUTION】中查询相关信息

select ID_ from ACT_RU_EXECUTION where PROC_DEF_ID_ = ? and PARENT_ID_ is null

【process_393572ue:5:cbc656e8-7768-11ec-8d5e-00ffaabbccdd】

#PROC_DEF_ID_ 来自表【ACT_RE_PROCDEF】
<==      Total: 0

3.3、从流程实例历史记录表【ACT_HI_PROCINST】中查询相关信息

select ID_ from ACT_HI_PROCINST where PROC_DEF_ID_ = ?

<==      Total: 0

3.4、从流程定义信息表【ACT_PROCDEF_INFO】中查询

 select * from ACT_PROCDEF_INFO where PROC_DEF_ID_ = ?

 <==      Total: 0

3.5、从定时器表【 ACT_RU_TIMER_JOB】中查询

select J.* from ACT_RU_TIMER_JOB J where J.HANDLER_TYPE_ = ? and J.PROC_DEF_ID_ = ?

==> Parameters: timer-start-event(String), process_393572ue:5:cbc656e8-7768-11ec-8d5e-00ffaabbccdd(String)
<==      Total: 0

3.6、根据查询的实例id从流程定义表【ACT_RE_PROCDEF】中查询信息

select * from ACT_RE_PROCDEF where KEY_ = ? and (TENANT_ID_ = '' or TENANT_ID_ is null) and DERIVED_FROM_ is null and VERSION_ = (select max(VERSION_) from ACT_RE_PROCDEF where KEY_ = ? and (TENANT_ID_ = '' or TENANT_ID_ is null))

==> Parameters: process_393572ue(String), process_393572ue(String)
<==    Columns: ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_, SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_, DERIVED_FROM_, DERIVED_FROM_ROOT_, DERIVED_VERSION_
<==        Row: process_393572ue:5:cbc656e8-7768-11ec-8d5e-00ffaabbccdd, 2, 请假, name_iwn3ixdj, process_393572ue, 5, cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd, name_iwn3ixdj.bpmn, name_iwn3ixdj.process_393572ue.png, null, 0, 1, 1, , null, null, null, 0
<==      Total: 1

3.7、再次从流程定义表【ACT_RE_PROCDEF】中查询最新版本的流程定义

SELECT RES.* from ACT_RE_PROCDEF RES WHERE RES.KEY_ = ? and RES.VERSION_ < ? and (RES.TENANT_ID_ = '' or RES.TENANT_ID_ is null) order by RES.VERSION_ desc LIMIT ? OFFSET ?

==> Parameters: process_393572ue(String), 5(Integer), 1(Integer), 0(Integer)
<==    Columns: ID_, REV_, CATEGORY_, NAME_, KEY_, VERSION_, DEPLOYMENT_ID_, RESOURCE_NAME_, DGRM_RESOURCE_NAME_, DESCRIPTION_, HAS_START_FORM_KEY_, HAS_GRAPHICAL_NOTATION_, SUSPENSION_STATE_, TENANT_ID_, ENGINE_VERSION_, DERIVED_FROM_, DERIVED_FROM_ROOT_, DERIVED_VERSION_
<==        Row: process_393572ue:4:bcbefd04-7768-11ec-8d5e-00ffaabbccdd, 2, 请假, name_iwn3ixdj, process_393572ue, 4, bcaab1b1-7768-11ec-8d5e-00ffaabbccdd, name_iwn3ixdj.bpmn, name_iwn3ixdj.process_393572ue.png, null, 0, 1, 1, , null, null, null, 0
<==      Total: 1

4.1、根据部署id删除流程定义相关的bpmn文件

delete from ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = ?

==> Parameters: cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd(String)

4.2、从流程部署表【ACT_RE_DEPLOYMENT】中删除

delete from ACT_RE_DEPLOYMENT where ID_ = ?

==> Parameters: cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd(String)

4.3、从事件订阅表【ACT_RU_EVENT_SUBSCR】中删除

delete from ACT_RU_EVENT_SUBSCR where PROC_DEF_ID_ = ? and EXECUTION_ID_ is null and PROC_INST_ID_ is null

==> Parameters: process_393572ue:5:cbc656e8-7768-11ec-8d5e-00ffaabbccdd(String)

4.4、从运行时流程人员表【ACT_RU_IDENTITYLINK】中删除
任务参与者数据表。主要存储当前节点参与者的信息。

delete from ACT_RU_IDENTITYLINK where PROC_DEF_ID_ = ?

==> Parameters: process_393572ue:5:cbc656e8-7768-11ec-8d5e-00ffaabbccdd(String)
<==    Updates: 0

4.5、从流程定义表【ACT_RE_PROCDEF】中进行删除

delete from ACT_RE_PROCDEF where DEPLOYMENT_ID_ = ?

==> Parameters: cbb2a7d5-7768-11ec-8d5e-00ffaabbccdd(String)
<==    Updates: 1