当前位置:网站首页>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
边栏推荐
- Postgresql数据库character varying和character的区别说明
- 国家正规的股票交易app有哪些?使用安不安全
- Addition, deletion, modification and query of sqlhelper
- Codeforces 474 F. Ant colony
- 寫一下跳錶
- SQL注入报错注入函数图文详解
- 【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
- uva 12230 – Crossing Rivers(概率)「建议收藏」
- Ubuntu安装mysql8遇到的问题以及详细安装过程
- H3C s7000/s7500e/10500 series post stack BFD detection configuration method
猜你喜欢
SQL注入报错注入函数图文详解
Klocwork code static analysis tool
Klocwork 代码静态分析工具

【OpenCV 例程200篇】223. 特征提取之多边形拟合(cv.approxPolyDP)
![Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]](/img/af/61b384b1b6ba46aa1a6011f8a30085.png)
Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]

Small guide for rapid formation of manipulator (12): inverse kinematics analysis
![[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)](/img/1e/055df228853d9b464fc4bcbde0a7ee.png)
[200 opencv routines] 223 Polygon fitting for feature extraction (cv.approxpolydp)

程序猿赚的那点钱算个P啊!

使用枚举实现英文转盲文

The latest version of codesonar has improved functional security and supports Misra, c++ parsing and visualization
随机推荐
SQL注入报错注入函数图文详解
Magic weapon - sensitive file discovery tool
Is it safe to open an account of BOC shares in kainiu in 2022?
sqlHelper的增删改查
Word inversion implements "suggestions collection"
Details of C language integer and floating-point data storage in memory (including details of original code, inverse code, complement, size end storage, etc.)
Mysql子查询关键字的使用方式(exists)
Usage of MySQL subquery keywords (exists)
UVA 11080 – place the guards
恶魔奶爸 A0 英文零基础的自我提升路
EasyUI date control emptying value
现在网上开户安全么?想知道我现在在南宁,到哪里开户比较好?
私募基金在中国合法吗?安全吗?
Ubuntu安装mysql8遇到的问题以及详细安装过程
Validutil, "Rethinking the setting of semi supervised learning on graphs"
Demon daddy C
Is embedded system really safe? [how does onespin comprehensively solve the IC integrity problem for the development team]
Alibaba cloud award winning experience: how to mount NAS file system through ECS
Arlo's troubles
Description of the difference between character varying and character in PostgreSQL database