当前位置:网站首页>Activiti目录(五)驳回、重新发起、取消流程
Activiti目录(五)驳回、重新发起、取消流程
2022-07-06 09:30:00 【爱机车的程序猿】
目录
一、审核人驳回流程
| 思路 | |
|---|---|
| 根据流程实例ID和当前用户ID查询流程任务是否存在 | |
| 1.根据当前人员设置驳回节点状态 | |
| 存在 | 2.驳回节点状态退回审核任务到发起人 |
| – | – |
| 不存在 | 返回不成功状态码 |
/** * 驳回申请 * @param userId 用户ID * @param processInstanceId 流程实例ID * @return */
public Task rejectTest(String userId,String processInstanceId) {
// 查询当前审批节点
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).taskInvolvedUser(userId).singleResult();
if(null != task){
// 设置流程参数
Map<String, Object> args = new HashMap<>();
String assignee = task.getName();
args.put("applyState", Constants.EPIDEMIC_APPLY_STATE_BH);// 驳回状态
args.put("applyExamine", assignee);// 驳回任务节点
// 完成审批任务
taskService.complete(task.getId(), args);
}
// 返回修改后业务信息
return task;
}
二、重新发起流程
| 思路 | |
|---|---|
| 根据流程实例ID和当前用户ID查询流程任务是否存在 | |
| 1.根据当前人员设置重新申请节点状态 | |
| 存在 | 2.获取驳回人员信息 |
| 3.通过节点状态、驳回人员信息重新申请回到审核人员继续审核 | |
| – | – |
| 1.返回审核节点状态 | |
| 不存在 | 2.用原有业务逻辑进行重新申请 |
/** * * 重新申请 * @param userId 用户Id * @param processInstanceId 流程实例Id * @return 状态值 */
public String backProcessTest(String userId,String processInstanceId){
//设置流程参数:审批ID
Map<String, Object> args = new HashMap<>();
String applyExamine = runtimeService.getVariable(processInstanceId, "applyExamine")+""; //查看variable常量表
args.put("applyState", "6");
args.put("applyExamine", applyExamine);
//查询当前审批节点
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).taskAssignee(userId).singleResult();
//完成审批任务
if(null != task) {
taskService.complete(task.getId(), args);
return applyExamine;
}
return "";
}
三、取消流程
| 思路 | |
|---|---|
| 根据流程实例ID获取流程实例是否还在执行 | |
| 1.获取审核节点状态(是否审核中还是审核通过) | |
| 存在 | 2.根据审核节点状态判断中途取消、审核通过取消 |
| 3.结束流程实例 | |
| – | – |
| 1.返回审核节点状态 | |
| 不存在 | 2.业务代码处理流程业务表 |
/** * 取消申请 * @param userId 用户ID * @param processInstanceId 流程实例Id * @return 状态值 */
public Integer withdrawTest(String userId,String processInstanceId){
// 流程实例是否在执行
Execution execution = runtimeService.createExecutionQuery().parentId(processInstanceId).singleResult();
//查看variable常量表
int applyState = Integer.parseInt(runtimeService.getVariable(processInstanceId, "applyState")+"");
// 判断中途、审核通过撤销
applyState = applyState < 3 ? Constants.EPIDEMIC_APPLY_STATE_ZTCX : Constants.EPIDEMIC_APPLY_STATE_CX;
if(!Objects.isNull(execution)){
//学生取消,结束流程
runtimeService.deleteProcessInstance(execution.getProcessInstanceId(), "学生"+userId+"取消申请");
}
return applyState;
}
三、实例代码
审核人员查询代办任务:


审核人员驳回流程:


流程退回到发起人


重新发起申请

驳回人员查看代办


取消流程申请
查询代办任务:
取消流程:
取消人员查询任务时没有流程信息了
工作流程画图、部署、启动流程、查询代办/已办/已通过、审核、驳回、重新发起、取消申请讲解工作流的重要性
彩蛋:
1.整合Bpmnjs画图工具。
2.任务到达节点标红并显示图片。即将期待
边栏推荐
- Basic principles of video compression coding and audio compression coding
- DS18B20數字溫度計系統設計
- The most lost road I have ever walked through is the brain circuit of ByteDance programmers
- Solr new core
- 控制转移指令
- Mp4 format details
- JS time function Daquan detailed explanation ----- AHAO blog
- ~87 animation
- 字节跳动技术面试官现身说法:我最想pick什么样的候选人
- 数据传送指令
猜你喜欢

~76 sprite map

LeetCode 1552. Magnetic force between two balls

~81 long table

Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.

我在字节跳动「修电影」

Shell_ 00_ First meeting shell

How to configure hosts when setting up Eureka

搭建flutter环境入坑集合

Business system compatible database oracle/postgresql (opengauss) /mysql Trivia

One hundred questions of image processing (1-10)
随机推荐
字节跳动开源GAN模型压缩框架,算力最高节省97.8%丨ICCV 2021
When it comes to Google i/o, this is how ByteDance is applied to flutter
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
Record the error reason: terminate called after throwing an instance
Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]
Simply try the new amp model of deepfacelab (deepfake)
GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
~78 radial gradient
~72 horizontal and vertical alignment of text
Jedis
Business system compatible database oracle/postgresql (opengauss) /mysql Trivia
字节跳动多篇论文入选 CVPR 2021,精选干货都在这里了
Some instructions on whether to call destructor when QT window closes and application stops
Design of DS18B20 digital thermometer system
Description of project structure configuration of idea
LeetCode 1640. Can I connect to form an array
字节跳动技术新人培训全记录:校招萌新成长指南
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
7-4 harmonic average