当前位置:网站首页>Activiti directory (IV) inquiry agency / done, approved
Activiti directory (IV) inquiry agency / done, approved
2022-07-06 17:00:00 【Motorcycle loving program ape】
hold Activiti Into your head , Do it through inquiry / Have done 、 Audit fast entry
Catalog
Activiti( One ) Getting started
Activiti( 3、 ... and ) Deploy 、 Publishing process
One 、 Audit agent / Have done
| function | Ideas |
|---|---|
| 1. Query current user | |
| agency | 2. According to the current user ID Get the task to be audited |
| 3. Return the task information to be approved | |
| – | – |
| 1. Query current user | |
| Have done | 2. According to the current user ID Get historical audit tasks |
| 3. Return the historical audit task information |
/** * Audit list * TODO 1: Query users and permissions * TODO 2: Query user approval status * TODO 3: Get the current user's to-do task process * TODO 4: According to the task example ID Query business table information * TODO 5: Return business information * @return */
public DataGridPojo ingProessList(String applyState,String userId) {
// Current login user information
// User user = (User) this.session.getAttribute("currentLoginUser");
// Long userId = Long.valueOf(user.getUserId());
// Object userIds1 = runtimeService.getVariable(task.getProcessInstanceId() + "", "userIds1"); // see variable Often scale
List Result = new ArrayList();
if(applyState.equals(" To audit ")){
// View the records of the current user to be approved
List<Task> tasks = taskService.createTaskQuery().taskInvolvedUser(userId)
.orderByTaskCreateTime().desc()
.list();// Agent list
Result = tasks;
}else if(applyState.equals(" The approved ") || applyState.equals(" Approved by ")){
// Audit records have been made
List<HistoricTaskInstance> histTaskList = historyService.createHistoricTaskInstanceQuery().taskInvolvedUser(userId)
.orderByHistoricTaskInstanceStartTime().desc()
.list();// Done list
// Audited records ssss
List<HistoricTaskInstance> histTaskApproveds = histTaskList.stream().filter(h -> "epidemicGroup".equals(h.getName()) && null != h.getEndTime()).collect(Collectors.toList());
Result = applyState.equals(" The approved ")
? histTaskList : histTaskApproveds;
}
DataGridPojo dataGridPojo = new DataGridPojo();
dataGridPojo.setRows(Result);
return dataGridPojo;
}
Two 、 Sign for agency ( to examine )
| Ideas | |
|---|---|
| According to the process example ID And the current user ID Query whether the process task exists | |
| There is | 1. Set the approval node status according to the current personnel |
| 2. Complete the audit task through the node status | |
| – | – |
| non-existent | Return the unsuccessful status code |
/** * to examine * @param user User information * @param apply Business information */
public int aduit(User user,Apply apply){
// user ID
if(null == user) return -1;
// Query the current approval node
Task task = taskService.createTaskQuery().processInstanceId(apply.getProcessInstanceId()).taskInvolvedUser(user.getUserId()+"").singleResult();
int state = -1;
if(null != task) {
// Set process parameters : The examination and approval ID
Map<String, Object> args = new HashMap<>();
switch (task.getName()){
case "teacher":
state = Constants.EPIDEMIC_APPLY_STATE_LSSH;
break;
case "academy":
state=Constants.EPIDEMIC_APPLY_STATE_XSCSH;
break;
case "epidemicGroup":
state=Constants.EPIDEMIC_APPLY_STATE_GZXZSH;
break;
}
args.put("applyState", state);// Set process parameters
// Set the executor of the approval task
taskService.setAssignee(task.getId(),user.getUserId() + "");
try {
// Complete the approval task
taskService.complete(task.getId(), args);
} catch (Exception e) {
log.error(e.getMessage());
return -1;
}
}
return state;
}
3、 ... and 、 The sample code
agency :

Have done :

Audit agent :


Check the agent to see if it is finished :
Check whether the already done exists :
边栏推荐
- LeetCode 1560. The sector with the most passes on the circular track
- Train 100 pictures for 1 hour, and the style of the photos changes at will. There is a demo at the end of the article | siggraph 2021
- ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
- LeetCode 1984. Minimum difference in student scores
- MySQL日期函数
- After the subscript is used to assign a value to the string type, the cout output variable is empty.
- 7-12 inventory code base
- ~72 horizontal and vertical alignment of text
- 唯有学C不负众望 TOP4 S1E6:数据类型
- 字节跳动2022校招研发提前批宣讲会,同学们最关心的10个问题
猜你喜欢

原型链继承

逻辑运算指令

汇编语言段定义

~82 style of table

~68 Icon Font introduction

~Introduction to form 80

字节跳动开源GAN模型压缩框架,算力最高节省97.8%丨ICCV 2021
![[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.](/img/ef/2072aac5f85c7daf39174784dec7ee.jpg)
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.

~86m rabbit practice

The most lost road I have ever walked through is the brain circuit of ByteDance programmers
随机推荐
冯诺依曼体系结构
Mongodb在node中的使用
DS18B20数字温度计系统设计
~70 row high
8086 内存
Mongodb learning notes
姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
QT system learning series: 1.2 style sheet sub control lookup
LeetCode1556. Thousand separated number
Conception du système de thermomètre numérique DS18B20
Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
~87 animation
~69 other ways to use icon fonts
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
Alibaba cloud server builds SVN version Library
LeetCode 1562. Find the latest group of size M
Activit零零碎碎要人命的坑
唯有学C不负众望 TOP2 p1变量
面试集锦库