当前位置:网站首页>使用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);
}
边栏推荐
- [solution] package 'XXXX' is not in goroot
- ASP.NET学习& asp‘s one word
- Traversée des procédures stockées Oracle
- Force buckle 912 Sort array
- JVM GC garbage collection brief
- Meta Force原力元宇宙系统开发佛萨奇模式
- How to test CIS chip?
- Force buckle 989 Integer addition in array form
- 开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
- 基于深度学习的目标检测的更新迭代总结(持续更新ing)
猜你喜欢

Sword finger offer II 013 Sum of two-dimensional submatrix

力扣 2319. 判断矩阵是否是一个 X 矩阵

Yolov6:yolov6+win10--- train your own dataset

How to cooperate among multiple threads

One click deployment of any version of redis

vulnhub之school 1

Data island is the first danger encountered by enterprises in their digital transformation

Detailed explanation of Flink parallelism and slot

Vulnhub tre1

力扣 599. 两个列表的最小索引总和
随机推荐
mock.js从对象数组中任选数据返回一个数组
LeetCode力扣(剑指offer 36-39)36. 二叉搜索树与双向链表37. 序列化二叉树38. 字符串的排列39. 数组中出现次数超过一半的数字
怎样用Google APIs和Google的应用系统进行集成(1)—-Google APIs简介
Graduation season | regretful and lucky graduation season
[sword finger offer] sword finger offer II 012 The sum of left and right subarrays is equal
Opencv学习笔记 高动态范围 (HDR) 成像
Implement secondary index with Gaussian redis
【Auto.js】自动化脚本
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
SQL common optimization
c语言如何判定是32位系统还是64位系统
CSDN syntax description
Cuda版本不一致,编译apex报错
Precautions for cjson memory leakage
[résolution] le paquet « xxxx» n'est pas dans goroot
Classification automatique des cellules de modules photovoltaïques par défaut dans les images de lecture électronique - notes de lecture de thèse
How to cooperate among multiple threads
Force buckle 912 Sort array
BI的边界:BI不适合做什么?主数据、MarTech?该如何扩展?
Force buckle 2319 Judge whether the matrix is an X matrix