Hello Team,
Iam involving in a small poc.
1.where user will submit the details like user name,email,mobile number.
2.officer1 will review the user details then he will submit the status approved.
3.if the officer1 approves the request then request goes to officer2.
4.officer2 will also review the user details then he will approve the request.
A.how to transfer the user submitted details to the officer1,officer2 bcoz both the officers needs to review the details submitted by the user using java
B.after the officer1 submit the approvals it needs to go the officer2
c.iam unable to see the officer2 tasks if the officer1 completed his job
…
public void startProcess(Article article) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put(“author”, article.getAuthor());
variables.put(“url”, article.getUrl());
runtimeService.startProcessInstanceByKey(“test”, variables);
System.out.println("Process instances running = " + runtimeService.createProcessInstanceQuery().count());
System.out.println("Number of tasks : " + taskService.createTaskQuery().count());
System.out.println("Number of tasks after process start: "
+ taskService.createTaskQuery().count());
System.out.println(“Article was submitted”);
}
@Transactional
public List<Article> getTasks(String assignee) {
List<Task> tasks = taskService.createTaskQuery()
.taskCandidateGroup(assignee)
.list();
System.out.println(tasks.size());
List<Article> articles = tasks.stream()
.map(task -> {
Map<String, Object> variables = taskService.getVariables(task.getId());
return new Article(
task.getId(), (String) variables.get("author"), (String) variables.get("url"));
})
.collect(Collectors.toList());
return articles;
}
@Transactional
public void submitReview(Approval approval) {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("approved", approval.isStatus());
taskService.complete(approval.getId(), variables);
System.out.println("approved");
}
<?xml version="1.0" encoding="UTF-8"?>
SequenceFlow_1
SequenceFlow_1
SequenceFlow_2
SequenceFlow_2
SequenceFlow_4
SequenceFlow_7
SequenceFlow_4
SequenceFlow_9
SequenceFlow_7
SequenceFlow_11
${approved}
SequenceFlow_9
SequenceFlow_11
SequenceFlow_13
SequenceFlow_14
SequenceFlow_13
SequenceFlow_15
${approved}
SequenceFlow_14
SequenceFlow_16
${!approved}
SequenceFlow_15
SequenceFlow_16
![flowable|690x259](upload://aM2YwT3TveBkAowP5EsTjSFwkGM.jpeg)