当前位置:网站首页>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 :
边栏推荐
- Eureka single machine construction
- 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
- 算数运算指令
- One hundred questions of image processing (1-10)
- LeetCode 1584. Minimum cost of connecting all points
- LeetCode 1557. The minimum number of points that can reach all points
- 字节跳动技术新人培训全记录:校招萌新成长指南
- DS18B20数字温度计系统设计
- MySQL日期函数
- LeetCode 1641. Count the number of Lexicographic vowel strings
猜你喜欢
was unable to send heartbeat
汇编语言段定义
Yao BanZhi and his team came together, and the competition experts gathered together. What fairy programming competition is this?
The 116 students spent three days reproducing the ByteDance internal real technology project
Shell_ 02_ Text three swordsman
Shell_ 03_ environment variable
亮相Google I/O,字节跳动是这样应用Flutter的
Thank you for your invitation. I'm in the work area. I just handed in the code. I'm an intern in the next ByteDance
一个数10年工作经验的微服务架构老师的简历
Shell_ 04_ Shell script
随机推荐
~76 sprite map
Idea resolving jar package conflicts
README. txt
Continue and break jump out of multiple loops
7-12 inventory code base
Shell_ 05_ operator
登陆验证koa-passport中间件的简单使用
Error: case label `15 'not within a switch statement
DS18B20數字溫度計系統設計
Fdog series (V): use QT to imitate QQ to realize login interface to main interface, function chapter.
[unsolved]7-14 calculation diagram
@RequestMapping、@GetMapping
koa中间件
ByteDance 2022 school recruitment R & D advance approval publicity meeting, students' top 10 issues
Introduction to microservices
Some instructions on whether to call destructor when QT window closes and application stops
字节跳动技术新人培训全记录:校招萌新成长指南
string. How to choose h and string and CString
LeetCode 1551. Minimum operand to make all elements in the array equal
8086 CPU 内部结构