}
updated.setPropByRes(origPropByRes);
}
PropagationReporter propagationReporter =
ApplicationContextProvider.getApplicationContext().getBean(PropagationReporter.class);
if (tasks.isEmpty()) {
// SYNCOPE-459: take care of user virtual attributes ...
final PropagationByResource propByResVirAttr = binder.forceVirtualAttributes(
updated.getResult().getKey(),
actual.getVirtualAttributesToBeRemoved(),
actual.getVirtualAttributesToBeUpdated());
// SYNCOPE-501: update only virtual attributes (if any of them changed), change password must be null
tasks.addAll(propByResVirAttr.isEmpty() ? Collections.<PropagationTask>emptyList()
: propagationManager.getUserUpdateTaskIds(updated, null, actual.
getVirtualAttributesToBeRemoved(), actual.getVirtualAttributesToBeUpdated()));
}
if (!tasks.isEmpty()) {
try {
taskExecutor.execute(tasks, propagationReporter);
} catch (PropagationException e) {
LOG.error("Error propagation primary resource", e);
propagationReporter.onPrimaryResourceFailure(tasks);
}
}
// 4. prepare result, including propagation status on external resources
final UserTO updatedTO = binder.getUserTO(updated.getResult().getKey());
updatedTO.setPropagationStatusTOs(propagationReporter.getStatuses());
return updatedTO;
}