当前位置:网站首页>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
边栏推荐
- 国家正规的股票交易app有哪些?使用安不安全
- 恶魔奶爸 指南帖——简易版
- Static analysis of software defects codesonar 5.2 release
- Codeforces 474 F. Ant colony
- 单词反转实现「建议收藏」
- Unity3d 4.3.4f1 execution project
- Tensorflow2. How to run under x 1 Code of X
- Jetty:配置连接器[通俗易懂]
- Implement secondary index with Gaussian redis
- AADL inspector fault tree safety analysis module
猜你喜欢
Small guide for rapid formation of manipulator (12): inverse kinematics analysis
Lex & yacc of Pisa proxy SQL parsing
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
恶魔奶爸 B3 少量泛读,完成两万词汇量+
How does codesonar help UAVs find software defects?
Helix QAC 2020.2 new static test tool maximizes the coverage of standard compliance
Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]
Tensorflow2.x下如何运行1.x的代码
Implement secondary index with Gaussian redis
Onespin | solve the problems of hardware Trojan horse and security trust in IC Design
随机推荐
Unity3d 4.3.4f1 execution project
Implementation of mahout Pearson correlation
I wrote a markdown command line gadget, hoping to improve the efficiency of sending documents by garden friends!
万字总结数据存储,三大知识点
Lex & yacc of Pisa proxy SQL parsing
SQL注入报错注入函数图文详解
刚开户的能买什么股票呢?炒股账户安全吗
Demon daddy C
GridView defines its own time for typesetting "suggestions collection"
Unity3d 4.3.4f1执行项目
开户还得用身份证银行卡安全吗,我是小白不懂
Object-C programming tips timer "suggestions collection"
Codeforces round 296 (Div. 2) A. playing with paper[easy to understand]
Is it safe to open an account of BOC shares in kainiu in 2022?
gridView自己定义做时间排版「建议收藏」
【C语言】指针进阶---指针你真的学懂了吗?
easyui 日期控件清空值
Small guide for rapid formation of manipulator (12): inverse kinematics analysis
Small guide for rapid formation of manipulator (11): standard nomenclature of coordinate system
Numerical method for solving optimal control problem (0) -- Definition