10-22-2015 05:00 PM
boolean success = false;
while (!success)
{
List<Task> queuedTasks = getProcessEngine().getTaskService().createTaskQuery().orderByDueDateNullsFirst().asc().taskId("queued").list();
if (queuedTasks.size() > 0)
{
Task claimableTask = queuedTasks.get(0);
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("claimed", myProcessId); // There would be no other way to tell which task we claimed, would there?
try
{
getProcessEngine().getTaskService().complete(claimableTask.getId(), variables);
success = true;
}
catch (ActivitiObjectNotFoundException e)
{
// Something else claimed it? We'll try again.
}
}
else
break;
}
10-28-2015 02:51 PM
10-28-2015 03:39 PM
11-03-2015 06:59 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.