INSERT INTO ACT_RU_TASK
(ID_,REV_,EXECUTION_ID_,PROC_INST_ID_,PROC_DEF_ID_,NAME_,PARENT_TASK_ID_,DESCRIPTION_,TASK_DEF_KEY_,OWNER_,ASSIGNEE_,DELEGATION_,PRIORITY_,CREATE_TIME_,DUE_DATE_,SUSPENSION_STATE_)
VALUES
(#{id,jdbcType=VARCHAR}, #{rev,jdbcType=NUMERIC}, #{executionId,jdbcType=VARCHAR}, #{procInstId,jdbcType=VARCHAR}, #{procDefId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{parentTaskId,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{taskDefKey,jdbcType=VARCHAR}, #{owner,jdbcType=VARCHAR}, #{assignee,jdbcType=VARCHAR}, #{delegation,jdbcType=VARCHAR}, #{priority,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{dueDate,jdbcType=TIMESTAMP}, #{suspensionState,jdbcType=NUMERIC})
DELETE FROM ACT_RU_TASK
WHERE
ID_=#{id}
DELETE FROM ACT_RU_TASK where proc_inst_id_ in
#{instId}
DELETE FROM ACT_RU_IDENTITYLINK where PROC_INST_ID_ in
#{instId}
DELETE FROM ACT_RU_VARIABLE where PROC_INST_ID_ in
#{instId}
and NAME_ in ('nrOfInstances','nrOfCompletedInstances','nrOfActiveInstances','loopCounter')
delete FROM ACT_RU_TASK where execution_id_ in (
select id_ from ACT_RU_EXECUTION where PROC_INST_ID_
in
#{instId}
AND ID_ != PARENT_ID_
)
delete FROM ACT_RU_TASK where execution_id_ in (
select ID_ FROM ACT_RU_EXECUTION where PARENT_ID_
in
#{parentId}
AND ID_ != PARENT_ID_
)