当前位置:网站首页>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 :
边栏推荐
- ByteDance technical Interviewer: what kind of candidate do I want to pick most
- Erlang installation
- 这群程序员中的「广告狂人」,把抖音广告做成了AR游戏
- 服务器端渲染(SSR)和客户端渲染(CSR)的区别
- Shell_ 02_ Text three swordsman
- Fdog series (I): think about it. It's better to write a chat software. Then start with the imitation QQ registration page.
- MySQL字符串函数
- 100张图训练1小时,照片风格随意变,文末有Demo试玩|SIGGRAPH 2021
- Eureka high availability
- DS18B20數字溫度計系統設計
猜你喜欢
原型链继承
The "advertising maniacs" in this group of programmers turned Tiktok advertisements into ar games
Fdog series (VI): use QT to communicate between the client and the client through the server (less information, recommended Collection)
MySQL日期函数
One hundred questions of image processing (11-20)
汇编课后作业
~76 sprite map
~68 Icon Font introduction
Mongodb learning notes
汇编语言段定义
随机推荐
DOS 功能调用
How to configure hosts when setting up Eureka
The QT program compiled on CentOS lacks a MySQL driven solution
Many papers on ByteDance have been selected into CVPR 2021, and the selected dry goods are here
~78 radial gradient
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
redux使用说明
我走過最迷的路,是字節跳動程序員的腦回路
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
Notes on how the network is connected
字节跳动技术面试官现身说法:我最想pick什么样的候选人
LeetCode 1584. Minimum cost of connecting all points
Eureka single machine construction
冯诺依曼体系结构
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
Alibaba cloud server builds SVN version Library
Description of project structure configuration of idea
TypeScript基本操作
~74 JD top navigation bar exercise
7-8 likes (need to continue to improve)