Information Technology Reference
In-Depth Information
TaskSummary firstTask = tasks.iterator().next();
taskService.claim(firstTask.getId(), "john");
taskService.start(firstTask.getId(), "john");
Map<String, Object> results1 = new HashMap<String,
Object>();
results1.put("reqResult", req);
taskService.complete(firstTask.getId(), "john", results1);
The calls that we see in the preceding code snippet are made after a process is started to
get the tasks available for the user, john (one of the developers defined in the user data
source). Once we have the task available, we claim it, start it, and complete it. After this is
done, the process will be notified about the task completion and it will move to the next
wait state. This will be a User task owned by testers, so mary will be able to get a task
now to work on, as follows:
List<TaskSummary> marysTasks = taskService.
getTasksAssignedAsPotentialOwner("mary", "en-UK");
TaskSummary marysTask = marysTasks.iterator().next();
taskService.claim(marysTask.getId(), "mary");
taskService.start(marysTask.getId(), "mary");
Map<String, Object> results2 = new HashMap<String,
Object>();
req.addBug("bug 1");
results2.put("reqResult", req);
taskService.complete(marysTask.getId(), "mary", results2);
As you can see, these interactions are done exclusively through the Human task compon-
ent. This translates to an actual application where you have people who only need to
worry about working directly with Human tasks and let the application run the process in
the background, creating new tasks according to what the process dictates. The interfaces
needed for such a user perspective of the process runtime is defined in the following sec-
tion.
Search WWH ::




Custom Search