当前位置:网站首页>Use camunda to do workflow design and reject operations
Use camunda to do workflow design and reject operations
2022-07-07 21:20:00 【Maple forest [email protected]】
Judge whether to reject , Refer to the following table :
camunda Page representation :
Specific code implementation :
ActivityInstance tree = runtimeService.getActivityInstance(processInstanceId);
List<HistoricActivityInstance> resultList = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(processInstanceId)
.activityType("userTask")
.finished()
.orderByHistoricActivityInstanceEndTime()
.asc()
.list();
// Get the task node 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(" The operation of docking back to the specified task node ")
.startBeforeActivity(toActId)// Start the target active node
.execute();
taskKey : For the activity node that needs to be transferred back key
currentTaskId: For the current task id
Modify after rejection ACT_HI_TASKINST status state , It should not be repeated with the addition and subtraction status .
The modification logic is as follows :
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);
}
版权声明
本文为[Maple forest [email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071812417561.html
边栏推荐
- Arlo's troubles
- Implement secondary index with Gaussian redis
- 反诈困境,国有大行如何破局?
- 阿里云有奖体验:如何通过ECS挂载NAS文件系统
- Guava multithreading, futurecallback thread calls are uneven
- 2022年在启牛开中银股票的账户安全吗?
- Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
- Demon daddy A1 speech listening initial challenge
- Contour layout of margin
- Codeforces Round #275 (Div. 2) C – Diverse Permutation (构造)[通俗易懂]
猜你喜欢
Klocwork 代码静态分析工具
Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)
Tensorflow2. How to run under x 1 Code of X
Ubuntu安装mysql8遇到的问题以及详细安装过程
SQL注入报错注入函数图文详解
万字总结数据存储,三大知识点
C语言 整型 和 浮点型 数据在内存中存储详解(内含原码反码补码,大小端存储等详解)
Mysql子查询关键字的使用方式(exists)
随机推荐
Implement secondary index with Gaussian redis
H3C s7000/s7500e/10500 series post stack BFD detection configuration method
HDU4876ZCC loves cards(多校题)
恶魔奶爸 C
The little money made by the program ape is a P!
Awk processing JSON processing
Deployment, recall and deletion solutions - stsadm and PowerShell "suggestions collection"
I wrote a markdown command line gadget, hoping to improve the efficiency of sending documents by garden friends!
Feature generation
Guava multithreading, futurecallback thread calls are uneven
Addition, deletion, modification and query of sqlhelper
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
The difference between NPM uninstall and RM direct deletion
Is private equity legal in China? Is it safe?
Onespin | solve the problems of hardware Trojan horse and security trust in IC Design
Codeforces Round #296 (Div. 2) A. Playing with Paper[通俗易懂]
openGl超级宝典学习笔记 (1)第一个三角形「建议收藏」
Write a jump table
How to meet the dual needs of security and confidentiality of medical devices?
华泰证券可以做到万一佣金吗,万一开户安全嘛