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_
)