private void saveHistory(CDSHistoryVo histVo) throws StaleObjectException { histVo.setJobEndTime(new DateTime()); if(histVo.getErrorMessageIsNotNull() && histVo.getErrorMessage().length() > histVo.getErrorMessageMaxLength()) { histVo.setErrorMessage(histVo.getErrorMessage().substring(0, histVo.getErrorMessageMaxLength() - 1)); } histVo.validate(); DomainFactory domainFactory = getDomainFactory(); CDSHistory hist = CDSHistoryVoAssembler.extractCDSHistory(domainFactory, histVo); domainFactory.save(hist); }
private void saveErrorHistoryEntry(CDSHistoryVo histVo, CDSResultVo result) throws StaleObjectException { histVo.setErrorMessage(result.getErrorMessage()); histVo.setJobSuccessful(Boolean.FALSE); saveHistory(histVo); }