当前位置:网站首页>使用camunda做工作流设计,驳回操作
使用camunda做工作流设计,驳回操作
2022-07-07 18:13:00 【枫林残@】
判断是否驳回,可参照如下表格:


camunda页面表象:

具体代码实现:
ActivityInstance tree = runtimeService.getActivityInstance(processInstanceId);
List<HistoricActivityInstance> resultList = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId)
.activityType("userTask")
.finished()
.orderByHistoricActivityInstanceEndTime()
.asc()
.list();
//得到任务节点id
List<HistoricActivityInstance> historicActivityInstanceList = resultList.stream().filter(historicActivityInstance -> historicActivityInstance.getActivityId().equals(rejectTaskDTO.getTaskKey())).collect(Collectors.toList());
HistoricActivityInstance historicActivityInstance = historicActivityInstanceList.get(0);
String toActId = historicActivityInstance.getActivityId();
taskService.createComment(task.getId(), processInstanceId, rejectTaskDTO.getMessage());
runtimeService.createProcessInstanceModification(processInstanceId)
.cancelActivityInstance(getInstanceIdForActivity(tree, task.getTaskDefinitionKey()))
.cancelAllForActivity(currentTaskId)
.setAnnotation("进行了驳回到指定任务节点操作")
.startBeforeActivity(toActId)//启动目标活动节点
.execute();taskKey :为需要驳回到的活动节点key
currentTaskId:为当前任务id
驳回后要修改ACT_HI_TASKINST status状态,要不与加减签状态重复。
修改逻辑如下:
actHiTaskInstDao.updateHiTaskInstByIdArray(Arrays.asList(currentTaskId), Constant.DATE_TIME_CODE_FORMATTER.format(LocalDateTime.now()));
@Mapper
public interface ActHiTaskInstDao {
@Update(" <script> " +
" update ACT_HI_TASKINST set " +
" END_TIME_ = #{endTime}, DELETE_REASON_ = 'rejected' " +
" where ID_ in " +
" <foreach collection = 'taskIdLit' item = 't' separator = ',' open = '(' close = ')' > " +
" #{t}" +
" </foreach> " +
" </script> ")
int updateHiTaskInstByIdArray(@Param("taskIdLit") List<String> taskIdLit, @Param("endTime") String endTime);
}
边栏推荐
- Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
- 开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
- Force buckle 1037 Effective boomerang
- Ways to improve the utilization of openeuler resources 01: Introduction
- Machine learning notes - explore object detection datasets using streamlit
- Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
- 解决/bin/sh进去的容器运行可执行文件报not found的问题
- 基于深度学习的目标检测的更新迭代总结(持续更新ing)
- Force buckle 2319 Judge whether the matrix is an X matrix
- 力扣 1961. 检查字符串是否为数组前缀
猜你喜欢

How to cooperate among multiple threads

openEuler 有奖捉虫活动,来参与一下?

数据孤岛是企业数字化转型遇到的第一道险关

Jenkins 用户权限管理

Flink并行度和Slot详解

Opencv learning notes high dynamic range (HDR) imaging

关于cv2.dnn.readNetFromONNX(path)就报ERROR during processing node with 3 inputs and 1 outputs的解决过程【独家发布】

AIRIOT助力城市管廊工程,智慧物联守护城市生命线

Force buckle 599 Minimum index sum of two lists

Opencv学习笔记 高动态范围 (HDR) 成像
随机推荐
EasyGBS级联时,上级平台重启导致推流失败、画面卡住该如何解决?
【哲思与实战】程序设计之道
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
c语言如何判定是32位系统还是64位系统
Vulnhub tre1
vulnhub之school 1
Kubernetes——kubectl命令行工具用法详解
机器学习笔记 - 使用Streamlit探索对象检测数据集
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
Leetcode force buckle (Sword finger offer 36-39) 36 Binary search tree and bidirectional linked list 37 Serialize binary tree 38 Arrangement of strings 39 Numbers that appear more than half of the tim
使用高斯Redis实现二级索引
Solve the problem of incomplete display around LCD display of rk3128 projector
编译器优化那些事儿(4):归纳变量
How to implement safety practice in software development stage
How to test CIS chip?
基于深度学习的目标检测的更新迭代总结(持续更新ing)
Get webkitformboundary post login
Creation of kubernetes mysql8
使用高斯Redis实现二级索引
831. KMP string