• Flowable 工作流 删除任务


    任务删减

    重点表说明

    ACT_RU_EXECUTION

    • ACT_RU_EXECUTION 表(执行实例表):这个表和act_run_task表,一起控制了用户任务的产生与完成等。
    • 这个表是工作流程的核心表,这个表会体现主干与分支流程实例的概念,所以才有了执行实例这个叫法。
    • 流程每多一份分支就会在ACT_RU_EXECUTION表中创建一条记录,来记录分支的进度。
    • ACT_RU_EXECUTION的id_是任务表的execution_id_

    查询SQL

    select * from act_ru_identitylink where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from act_ru_task where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from act_ru_actinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from ACT_RU_EXECUTION where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from act_ru_variable where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from act_hi_identitylink where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from act_hi_taskinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187';
    select * from act_hi_actinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' ;
    select * from act_hi_detail where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' ;
    select * from act_hi_procinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' ;`
    
    `select * from act_ru_identitylink where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' or task_id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_ru_task where execution_id_='a247d8f4-56b9-11ee-bd0b-a6db891ed187';
    select * from act_ru_actinst where execution_id_='a247d8f4-56b9-11ee-bd0b-a6db891ed187';
    select * from act_ru_variable where execution_id_='a247d8f4-56b9-11ee-bd0b-a6db891ed187';
    select long_,text_ from act_ru_variable where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' and name_='nrOfInstances';
    select long_,text_ from act_ru_variable where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' and name_='nrOfActiveInstances';
    select * from ACT_RU_EXECUTION where id_='a247d8f4-56b9-11ee-bd0b-a6db891ed187';
    select * from act_hi_identitylink where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' or task_id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_hi_taskinst where execution_id_='a247d8f4-56b9-11ee-bd0b-a6db891ed187';
    select * from act_hi_actinst where execution_id_='a247d8f4-56b9-11ee-bd0b-a6db891ed187';`
    
    `select * from act_ru_identitylink where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' or task_id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_ru_task where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' and id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_ru_actinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' and task_id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_hi_identitylink where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' or task_id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_hi_taskinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' and id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    select * from act_hi_actinst where proc_inst_id_='baadc7cb-56be-11ee-bd0b-a6db891ed187' and task_id_='1a0102dd-56bf-11ee-bd0b-a6db891ed187';
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28

    删除方法

    运行中数据

        @Delete(value = "delete from act_ru_identitylink where task_id_=#{taskId}")
        void deleteRunIdentitylink(@Param("taskId") String taskId);
    
        @Delete(value = "delete from act_ru_task where proc_inst_id_=#{processInstanceId} and id_=#{taskId}")
        void deleteRunTask(@Param("processInstanceId") String processInstanceId,@Param("taskId") String taskId);
    
        @Delete(value = "delete from act_ru_actinst where proc_inst_id_=#{processInstanceId} and task_id_=#{taskId}")
        void deleteRunActinst(@Param("processInstanceId") String processInstanceId,@Param("taskId") String taskId);
    
        @Delete(value = "delete from ACT_RU_EXECUTION where id_=#{executionId}")
        void deleteRunExecution(@Param("executionId")String executionId);
    
        @Delete(value = "delete from act_ru_variable where execution_id_=#{executionId}")
        void deleteRunVariable(@Param("executionId")String executionId);
    
        @Update(value = "UPDATE act_ru_variable set long_=long_-1,text_=text_-1 where proc_inst_id_=#{processInstanceId} and name_=#{name}")
        void updateRunVariable(@Param("processInstanceId")String processInstanceId, @Param("name")String name);
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17

    历史数据

        @Delete(value = "delete from act_hi_identitylink where task_id_=#{taskId}")
        void deleteHisIdentitylink(@Param("taskId") String taskId);
    
        @Delete(value = "delete from act_hi_taskinst where proc_inst_id_=#{processInstanceId} and id_=#{taskId}")
        void deleteHisTask(@Param("processInstanceId") String processInstanceId,@Param("taskId") String taskId);
    
        @Delete(value = "delete from act_hi_actinst where proc_inst_id_=#{processInstanceId} and task_id_=#{taskId}")
        void deleteHisActinst(@Param("processInstanceId") String processInstanceId, @Param("taskId") String taskId);
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    包容网关任务删减

            Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
            runFlowableActinstDao.deleteRunIdentitylink(taskId);
            runFlowableActinstDao.deleteRunTask(processInstanceId,taskId);
            runFlowableActinstDao.deleteRunActinst(processInstanceId,taskId);
            runFlowableActinstDao.deleteRunExecution(task.getExecutionId());
            hisFlowableActinstDao.deleteHisIdentitylink(taskId);
            hisFlowableActinstDao.deleteHisTask(processInstanceId,taskId);
            hisFlowableActinstDao.deleteHisActinst(processInstanceId,taskId);
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    多实例节点任务删

    多实例节点生产数据说明

    • nrOfInstances:创建的实例总数
    • nrOfActiveInstances:当前活动的实例数,针对顺序类型的多实例,该变量值等于1
    • nrOfCompletedInstances:已执行实例数
            Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
            runFlowableActinstDao.deleteRunIdentitylink(taskId);
            runFlowableActinstDao.deleteRunTask(processInstanceId,taskId);
            runFlowableActinstDao.deleteRunActinst(processInstanceId,taskId);
            runFlowableActinstDao.deleteRunVariable(task.getExecutionId());
            runFlowableActinstDao.updateRunVariable(processInstanceId,"nrOfInstances");
            runFlowableActinstDao.updateRunVariable(processInstanceId,"nrOfActiveInstances");
            runFlowableActinstDao.deleteRunExecution(task.getExecutionId());
            hisFlowableActinstDao.deleteHisIdentitylink(taskId);
            hisFlowableActinstDao.deleteHisTask(processInstanceId,taskId);
            hisFlowableActinstDao.deleteHisActinst(processInstanceId,taskId);
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
  • 相关阅读:
    终止Promise的执行
    手撸代码,Redis发布订阅机制实现
    准备熬夜加班?curl&libcurl 高危漏洞明日公布
    mac版Idea快捷键
    AI创新下的生成式人工智能——Amazon Bedrock
    RedisConnectionException: Unable to connect to 127.0.0.1:6379
    设计模式-命令模式(Command)
    京东云开发者|mysql基于binlake同步ES积压解决方案
    妙手ERP功能更新丨Shopee全球产品支持使用定价模板修改价格、Ozon新增SKU模板 、Temu采集箱支持添加货源链接......
    认识异常【超详细】
  • 原文地址:https://blog.csdn.net/qq_26949717/article/details/133064854