当前位置:网站首页>Activiti directory (V) reject, restart and cancel process
Activiti directory (V) reject, restart and cancel process
2022-07-06 17:00:00 【Motorcycle loving program ape】
hold Activiti Into your head , Rejected again 、 Cancel the process and quickly enter
Catalog
Activiti( One ) Getting started
Activiti( 3、 ... and ) Deploy 、 Publishing process
Activiti( Four ) Inquiry agent / Have done 、 to examine
One 、 The reviewer rejected the process
Ideas | |
---|---|
According to the process example ID And the current user ID Query whether the process task exists | |
1. Set the rejection node status according to the current personnel | |
There is | 2. Reject the node status and return the approval task to the initiator |
– | – |
non-existent | Return the unsuccessful status code |
/** * Reject the application * @param userId user ID * @param processInstanceId Process instance ID * @return */
public Task rejectTest(String userId,String processInstanceId) {
// Query the current approval node
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).taskInvolvedUser(userId).singleResult();
if(null != task){
// Set process parameters
Map<String, Object> args = new HashMap<>();
String assignee = task.getName();
args.put("applyState", Constants.EPIDEMIC_APPLY_STATE_BH);// Rejection status
args.put("applyExamine", assignee);// Reject task node
// Complete the approval task
taskService.complete(task.getId(), args);
}
// Return the modified business information
return task;
}
Two 、 Re initiate the process
Ideas | |
---|---|
According to the process example ID And the current user ID Query whether the process task exists | |
1. Re apply node status according to current personnel settings | |
There is | 2. Get the rejected person information |
3. Through node status 、 Reject the application for personnel information and return to the reviewer to continue the review | |
– | – |
1. Return to the approval node status | |
non-existent | 2. Re apply with the original business logic |
/** * * Reapply * @param userId user Id * @param processInstanceId Process instance Id * @return The status value */
public String backProcessTest(String userId,String processInstanceId){
// Set process parameters : The examination and approval ID
Map<String, Object> args = new HashMap<>();
String applyExamine = runtimeService.getVariable(processInstanceId, "applyExamine")+""; // see variable Often scale
args.put("applyState", "6");
args.put("applyExamine", applyExamine);
// Query the current approval node
Task task = taskService.createTaskQuery().processInstanceId(processInstanceId).taskAssignee(userId).singleResult();
// Complete the approval task
if(null != task) {
taskService.complete(task.getId(), args);
return applyExamine;
}
return "";
}
3、 ... and 、 Cancel the process
Ideas | |
---|---|
According to the process example ID Get whether the process instance is still executing | |
1. Get the status of the audit node ( Whether it is under review or approved ) | |
There is | 2. Judge the midway cancellation according to the status of the approval node 、 Approved and cancelled |
3. End process instance | |
– | – |
1. Return to the approval node status | |
non-existent | 2. Business code processing process business table |
/** * withdraw * @param userId user ID * @param processInstanceId Process instance Id * @return The status value */
public Integer withdrawTest(String userId,String processInstanceId){
// Whether the process instance is executing
Execution execution = runtimeService.createExecutionQuery().parentId(processInstanceId).singleResult();
// see variable Often scale
int applyState = Integer.parseInt(runtimeService.getVariable(processInstanceId, "applyState")+"");
// Judge halfway 、 Approved and revoked
applyState = applyState < 3 ? Constants.EPIDEMIC_APPLY_STATE_ZTCX : Constants.EPIDEMIC_APPLY_STATE_CX;
if(!Objects.isNull(execution)){
// Students cancel , End the process
runtimeService.deleteProcessInstance(execution.getProcessInstanceId(), " Student "+userId+" withdraw ");
}
return applyState;
}
3、 ... and 、 The sample code
The reviewer inquires about the delegated tasks :
Reviewers reject the process :
The process returns to the originator
Reissue the application
Reject personnel to view the agent
Cancel the process application
Query the agent task :
Cancel the process :
There is no process information when canceling the personnel query task
Workflow drawing 、 Deploy 、 Start process 、 Inquiry agent / Have done / Passed 、 to examine 、 rejected 、 Relaunch 、 Cancel the application and explain the importance of workflow
Colored eggs :
1. Integrate Bpmnjs drawing tools .
2. When the task arrives at the node, it is marked in red and the picture is displayed . Looking forward to
边栏推荐
- Full record of ByteDance technology newcomer training: a guide to the new growth of school recruitment
- Solr standalone installation
- DS18B20数字温度计系统设计
- [unsolved]7-14 calculation diagram
- LeetCode 1560. The sector with the most passes on the circular track
- 唯有学C不负众望 TOP5 S1E8|S1E9:字符和字符串&&算术运算符
- js垃圾回收机制和内存泄漏
- Idea resolving jar package conflicts
- ~79 Movie card exercise
- Alibaba cloud server docker installation mysql5.5
猜你喜欢
Install docker under windows10 (through Oracle VM VirtualBox)
~79 Movie card exercise
Ruoyi-Cloud 踩坑的BUG
MySQL字符串函数
~76 sprite map
LeetCode 1584. Minimum cost of connecting all points
LeetCode 1557. The minimum number of points that can reach all points
The QT program compiled on CentOS lacks a MySQL driven solution
README. txt
LeetCode 1020. Number of enclaves
随机推荐
Introduction to microservices
字节跳动技术新人培训全记录:校招萌新成长指南
一个数10年工作经验的微服务架构老师的简历
DS18B20数字温度计系统设计
数据传送指令
算数运算指令
Typescript basic operations
LeetCode 1552. Magnetic force between two balls
"One year after graduation, I won ACL best paper"
Full record of ByteDance technology newcomer training: a guide to the new growth of school recruitment
Restful style interface design
High performance mysql (Third Edition) notes
Install docker under windows10 (through Oracle VM VirtualBox)
MySQL optimization notes
Description of project structure configuration of idea
ByteDance open source Gan model compression framework, saving up to 97.8% of computing power - iccv 2021
The difference between URI and URL
~73 other text styles
Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]
在 vi 编辑器中的命令模式下,删除当前光标处的字符使用 __ 命 令。