当前位置:网站首页>使用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);
}
边栏推荐
- Cloud component development and upgrading
- Traversée des procédures stockées Oracle
- 有了ST7008, 蓝牙测试完全拿捏住了
- Force buckle 599 Minimum index sum of two lists
- 力扣 1037.有效的回旋镖
- Semantic slam source code analysis
- TS quick start - Generic
- 一. 基础概念
- 图扑数字孪生煤矿开采系统,打造采煤“硬实力”
- Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
猜你喜欢
多个线程之间如何协同
微服务远程Debug,Nocalhost + Rainbond微服务开发第二弹
AIRIOT助力城市管廊工程,智慧物联守护城市生命线
有了ST7008, 蓝牙测试完全拿捏住了
[philosophy and practice] the way of program design
The state cyberspace Office released the measures for data exit security assessment: 100000 information provided overseas needs to be declared
Data island is the first danger encountered by enterprises in their digital transformation
Opencv学习笔记 高动态范围 (HDR) 成像
mock.js从对象数组中任选数据返回一个数组
Implement secondary index with Gaussian redis
随机推荐
毕业季|遗憾而又幸运的毕业季
搞定带WebKitFormBoundary post登录
Mongodb由浅入深学习
开源重器!九章云极DataCanvas公司YLearn因果学习开源项目即将发布!
一文读懂数仓中的pg_stat
Vulnhub's funfox2
The boundary of Bi: what is bi not suitable for? Master data, Martech? How to expand?
Detailed explanation of Flink parallelism and slot
国家网信办公布《数据出境安全评估办法》:累计向境外提供10万人信息需申报
AIRIOT助力城市管廊工程,智慧物联守护城市生命线
kubernetes之创建mysql8
Traversée des procédures stockées Oracle
九度 1201 -二叉排序数遍历- 二叉排序树「建议收藏」
力扣674. 最长连续递增序列
力扣 459. 重复的子字符串
机器学习笔记 - 使用Streamlit探索对象检测数据集
How to cooperate among multiple threads
Read PG in data warehouse in one article_ stat
Force buckle 459 Duplicate substring
【哲思与实战】程序设计之道