当前位置:网站首页>使用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);
}
边栏推荐
- openEuler 有奖捉虫活动,来参与一下?
- Yolov6:yolov6+win10--- train your own dataset
- 写了个 Markdown 命令行小工具,希望能提高园友们发文的效率!
- Gorilla official: sample code for golang to open websocket client
- ASP. Net learning & ASP's one word
- 力扣674. 最长连续递增序列
- 力扣 1961. 检查字符串是否为数组前缀
- Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
- 力扣 2319. 判断矩阵是否是一个 X 矩阵
- Traversée des procédures stockées Oracle
猜你喜欢
MRS离线数据分析:通过Flink作业处理OBS数据
Detailed explanation of Flink parallelism and slot
Open source heavy ware! Chapter 9 the open source project of ylarn causal learning of Yunji datacanvas company will be released soon!
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
mock.js从对象数组中任选数据返回一个数组
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
vulnhub之school 1
BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?
【哲思与实战】程序设计之道
机器学习笔记 - 使用Streamlit探索对象检测数据集
随机推荐
Kubernetes -- detailed usage of kubectl command line tool
力扣 1232.缀点成线
Force buckle 88 Merge two ordered arrays
c语言如何判定是32位系统还是64位系统
Graduation season | regretful and lucky graduation season
关于自身的一些安排
Solve the problem of incomplete display around LCD display of rk3128 projector
【Auto.js】自动化脚本
The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
Cloud component development and upgrading
恢复持久卷上的备份数据
Sword finger offer II 013 Sum of two-dimensional submatrix
Splicing and splitting of integer ints
php 获取图片信息的方法
Force buckle 599 Minimum index sum of two lists
力扣 643. 子数组最大平均数 I
Semantic slam source code analysis
torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
使用高斯Redis实现二级索引
线性基