@Override
public ModificationInfo setCommitteeDirection(CommitteeDirectionDetails details) throws ClipsServerException {
checkCommandAccessibility(COMMAND_MODIFY);
Committee entity = getExistentEntity();
CommitteeDirection direct = null;
AuditDoc<CommitteeDirection> auditDoc;
if(details.id != 0) {
direct = findEntity(CommitteeDirection.class, details.id);
auditDoc = new AuditDoc<CommitteeDirection>(direct, getCollaborator());
checkTheSame(direct.getCommittee());
} else {
direct = new CommitteeDirection();
auditDoc = new AuditDoc<CommitteeDirection>(direct, getCollaborator());
direct.setCommittee(entity);
}
direct.setDirection(findEntity(Direction.class, details.directionID));
int id = saveEntity(direct);
auditDoc.check(direct);
return new ModificationInfo(id, persistAudit(auditDoc));
}