这会部长可以驳回员工的请假申请,用户要调整,主任也可以驳回员工的申请
调整申请表这个任务的user:${applyuser}
加入判断的变量
刚开始也是模拟提交一张。
@Test public void TestAddLeave() {//添加请假单 identityService.setAuthenticatedUserId("a5fd2d9c-2de0-440c-b430-7c7daacc7d5e"); runtimeService.startProcessInstanceByKey("leave"); }
@Test
public void TestRubzClaim() {//某一个部长认领任务
List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("7b2290f1-d929-4442-8624-99d7852b024f").list();
for (Task task : tasks) {
taskService.claim(task.getId(), "ed2607af-1194-442e-bfcd-3b6cd69ced98");
}
}
@Test
public void TestRubzComplete(){//这个部长批复
List<Task> tasks = taskService.createTaskQuery().taskAssignee("ed2607af-1194-442e-bfcd-3b6cd69ced98").list();
for (Task task : tasks) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("bztongbi", true);//这里加入判断的变量
taskService.complete(task.getId(), variables);
}
/*for (Task task : tasks) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("bztongbi", false);
taskService.complete(task.getId(), variables);
}*/
}
@Test
public void TestRuzrClaim() {//某一个主任认领任务
List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("1f0e5af8-f09a-4425-8fa5-96bbc89cfb80").list();
for (Task task : tasks) {
taskService.claim(task.getId(), "3396e6da-3639-465e-a3b2-c8562f525a24");
}
}
@Test
public void TestRuzrComplete(){//这个主任批复
List<Task> tasks = taskService.createTaskQuery().taskAssignee("3396e6da-3639-465e-a3b2-c8562f525a24").list();
for (Task task : tasks) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("zrtongbi", true);
taskService.complete(task.getId(), variables);
}
}
@Test public void TestRuUserClaim() {//某一个用户认领任务 List<Task> tasks = taskService.createTaskQuery().taskCandidateUser("a5fd2d9c-2de0-440c-b430-7c7daacc7d5e").list(); for (Task task : tasks) { taskService.claim(task.getId(), "a5fd2d9c-2de0-440c-b430-7c7daacc7d5e"); } } @Test public void TestRuUserComplete(){//这个用户批复 List<Task> tasks = taskService.createTaskQuery().taskAssignee("a5fd2d9c-2de0-440c-b430-7c7daacc7d5e").list(); for (Task task : tasks) { taskService.complete(task.getId()); } }