3
votes

human task status not changing(still showing in Ready state) after successfully execution of the method

private void claimTask(TaskClient taskClient, String taskOwnerName, TaskSummary task) {
BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
taskClient.claim(task.getId(), taskOwnerName, operationResponseHandler);
logger.debug("clamed task status is: " + task.getStatus());

}

logger says task still is in Ready state. Status must move to Reserved state.

1

1 Answers

1
votes

The TaskSummary object that you are using is a detached object that is not directly linked to the underlying database. It doesn't reflect the most current state of the Task in the database after the execution of the 'claim' method. For the latest state of the task, I would suggest retrieving it first before logging its state which like so:

private void claimTask(TaskClient taskClient, String taskOwnerName, TaskSummary task) {
  BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
  taskClient.claim(task.getId(), taskOwnerName, operationResponseHandler);
  BlockingGetTaskResponseHandler getTaskHandler=new BlockingGetTaskResponseHandler();
  taskClient.getTaskById(task.getId(),getTaskHandler);
  logger.debug("claimed task status is: " + getTaskHandler.getTask().getStatus());
}