当前位置:网站首页>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
边栏推荐
- ~Introduction to form 80
- After the subscript is used to assign a value to the string type, the cout output variable is empty.
- yum install xxx报错
- 100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
- 唯有学C不负众望 TOP2 p1变量
- GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
- Fdog series (4): use the QT framework to imitate QQ to realize the login interface, interface chapter.
- LeetCode 1550. There are three consecutive arrays of odd numbers
- ~68 Icon Font introduction
- Solr word segmentation analysis
猜你喜欢
![Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]](/img/e6/c53ad67ead1793a2acb93c26e8d377.jpg)
Saw local status change event StatusChangeEvent [timestamp=1644048792587, current=DOWN, previous=UP]

搭建flutter环境入坑集合

redux使用说明

我走过最迷的路,是字节跳动程序员的脑回路

LeetCode 1584. Minimum cost of connecting all points

汇编语言寻址方式

"One year after graduation, I won ACL best paper"
![[unsolved]7-14 calculation diagram](/img/33/39802c0106f2bef4b9979e5ae12b83.jpg)
[unsolved]7-14 calculation diagram

ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues

字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」
随机推荐
冯诺依曼体系结构
~71 abbreviation attribute of font
Usage of insert() in vector
Some instructions on whether to call destructor when QT window closes and application stops
Design of DS18B20 digital thermometer system
The most lost road I have ever walked through is the brain circuit of ByteDance programmers
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
~77 linear gradient
逻辑运算指令
LeetCode 1984. Minimum difference in student scores
@RequestMapping、@GetMapping
Alibaba cloud server builds SVN version Library
How to configure hosts when setting up Eureka
7-4 harmonic average
One hundred questions of image processing (11-20)
数据传送指令
Shell_ 02_ Text three swordsman
Shell_ 06_ Judgment and circulation
was unable to send heartbeat
字节跳动开源GAN模型压缩框架,算力最高节省97.8%丨ICCV 2021