当前位置:网站首页>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
边栏推荐
- Mahout-Pearson correlation的实现
- Codesonar enhances software reliability through innovative static analysis
- AADL inspector fault tree safety analysis module
- Feature generation
- Description of the difference between character varying and character in PostgreSQL database
- Demon daddy guide post - simple version
- Magic weapon - sensitive file discovery tool
- easyui 日期控件清空值
- 恶魔奶爸 B1 听力最后壁垒,一鼓作气突破
- 部署、收回和删除解决方式—-STSADM和PowerShell「建议收藏」
猜你喜欢
How to meet the dual needs of security and confidentiality of medical devices?
Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
Klocwork code static analysis tool
Codesonar Webinar
【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
【C语言】指针进阶---指针你真的学懂了吗?
CodeSonar如何帮助无人机查找软件缺陷?
MySQL storage expression error
How to meet the dual needs of security and confidentiality of medical devices?
Implement secondary index with Gaussian redis
随机推荐
gridView自己定义做时间排版「建议收藏」
Devil daddy A0 English zero foundation self-improvement Road
现在网上开户安全么?想知道我现在在南宁,到哪里开户比较好?
国家正规的股票交易app有哪些?使用安不安全
EasyUI date control emptying value
Datatable data conversion to entity
阿里云有奖体验:如何通过ECS挂载NAS文件系统
Can Huatai Securities achieve Commission in case of any accident? Is it safe to open an account
Differences and connections between MinGW, mingw-w64, tdm-gcc and other tool chains "suggestions collection"
Lex & yacc of Pisa proxy SQL parsing
POJ 3140 contents division "suggestions collection"
恶魔奶爸 A1 语音听力初挑战
写一下跳表
Awk processing JSON processing
Cantata9.0 | new features
95年专注安全这一件事 沃尔沃未来聚焦智能驾驶与电气化领域安全
Demon daddy B3 read extensively in a small amount, and completed 20000 vocabulary+
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)
The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
目标:不排斥 yaml 语法。争取快速上手