if (job.getState() == Job.NONE || job.getRealResult() != null) {
return writeResult(request, response, job, statusHandler, strategy);
} else {
TaskInfo task = job.startTask();
task.setUnqualificationStrategy(strategy);
JSONObject result = task.toJSON();
URI taskLocation = createTaskLocation(ServletResourceHandler.getURI(request), task.getId(), task.isKeep());
result.put(ProtocolConstants.KEY_LOCATION, taskLocation);
if (!task.isRunning()) {
job.removeTask(); // Task is not used, we may remove it
return writeResult(request, response, job, statusHandler, strategy);