@Override
public ModificationInfo setCommitteeInability(InabilityDetails details) throws ClipsServerException {
checkCommandAccessibility(COMMAND_MODIFY);
checkEntityExist();
Inability inability = null;
AuditDoc<Inability> auditDoc;
if(details.id != 0) {
inability = findEntity(Inability.class, details.id);
auditDoc = new AuditDoc<Inability>(inability, getCollaborator());
checkTheSame(inability.getCommitteeResolution().getDirection().getCommittee());
} else {
inability = new Inability();
auditDoc = new AuditDoc<Inability>(inability, getCollaborator());
inability.setCommitteeResolution(findEntity(CommitteeResolution.class, details.committeeResolutionID));
}
inability.setDate(details.date);
inability.setAnswerDate(details.dateAnswer);
inability.setDesc(details.desc);
inability.setLevelIn(details.levelIn);
inability.setLevelOut(details.levelOut);
int id = saveEntity(inability);
auditDoc.check(inability);
return new ModificationInfo(id, persistAudit(auditDoc));
}