use of org.mifos.rest.approval.domain.ApprovalMethod in project head by mifos.
the class StandardApprovalService method approve.
@Transactional
@Override
public Object approve(Long id) throws Exception {
RESTApprovalEntity entity = approvalDao.getDetails(id);
ApprovalMethod am = entity.getApprovalMethod();
Object result = null;
try {
result = excuteMethod(am);
entity.setState(ApprovalState.APPROVED);
} catch (Exception e) {
skipCreate = false;
result = "Error : " + interceptError(e);
}
entity.setApprovedBy(getCurrentUserId());
entity.setApprovedOn(new DateTime());
approvalDao.update(entity);
return result;
}
Aggregations