TaskExec exec = taskExecDAO.find(executionId);
if (exec == null) {
throw new NotFoundException("Task execution " + executionId);
}
SyncopeClientException sce = new SyncopeClientException(
SyncopeClientExceptionType.InvalidPropagationTaskExecReport);
TaskUtil taskUtil = getTaskUtil(exec.getTask());
if (TaskUtil.PROPAGATION == taskUtil) {
PropagationTask task = (PropagationTask) exec.getTask();
if (task.getPropagationMode() != PropagationMode.TWO_PHASES) {
sce.addElement("Propagation mode: " + task.getPropagationMode());
}
} else {
sce.addElement("Task type: " + taskUtil);
}
switch (status) {
case SUCCESS:
case FAILURE:
break;
case CREATED:
case SUBMITTED:
case UNSUBMITTED:
sce.addElement("Execution status to be set: " + status);
break;
default:
}
if (!sce.isEmpty()) {
SyncopeClientCompositeErrorException scce =
new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
scce.addException(sce);
auditManager.audit(Category.task, TaskSubCategory.report, Result.failure,