System.out.println("Process had node we are looking for.");
assertNodeTriggered(processInstance.getId(), "Start", "Approve Reward");
System.out.println("Process has triggerd node we expect it to do.");
// execute task by Mary from HR.
BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
// find our tasks for user.
client.getTasksAssignedAsPotentialOwner("mary", "en-UK", taskSummaryResponseHandler);
List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
// claim and get started on task.
System.out.println("Size of task list: " + tasks.size());
client.claim(tasks.get(0).getId(), "mary", responseHandler);
responseHandler.waitTillDone(1000);