dao.close();
}
}
public OMElement getAvailableTasks(final OMElement requestElement) throws AxisFault {
ITaskDAOConnection dao=null;
try {
dao=_taskDAOFactory.openConnection();
OMElementQueue rootQueue = new OMElementQueue(requestElement);
String participantToken = requireElementValue(rootQueue, "participantToken");
String taskType = requireElementValue(rootQueue, "taskType");
String subQuery = requireElementValue(rootQueue, "subQuery");
String first = expectElementValue(rootQueue, "first");
String max = expectElementValue(rootQueue, "max");
HashMap map = new HashMap();
map.put(TaskFetcher.FETCH_CLASS_NAME, taskType);
map.put(TaskFetcher.FETCH_SUB_QUERY, subQuery);
map.put(TaskFetcher.FETCH_FIRST, first);
map.put(TaskFetcher.FETCH_MAX, max);
final UserRoles user = _server.getUserRoles(participantToken);
Task[] tasks = _server.getAvailableTasks(dao,participantToken, map);
OMElement result = marshalTasksList(user, tasks, "getAvailableTasksResponse");
return result;
} catch (Exception e) {
throw makeFault(e);
}
finally{
if(dao!=null)
dao.close();
}
}