use of org.apache.ojb.broker.cache.RuntimeCacheException in project cu-kfs by CU-CommunityApps.
the class CheckReconciliationMaintainableImpl method doRouteStatusChange.
/**
* @see org.kuali.kfs.kns.maintenance.KualiMaintainableImpl#doRouteStatusChange(org.kuali.kfs.kns.bo.DocumentHeader)
*/
public void doRouteStatusChange(DocumentHeader documentHeader) {
WorkflowDocument workflowDocument = documentHeader.getWorkflowDocument();
if (workflowDocument.isProcessed() && !KFSConstants.MAINTENANCE_NEW_ACTION.equalsIgnoreCase(getMaintenanceAction())) {
DocumentService documentService = SpringContext.getBean(DocumentService.class);
MaintenanceDocument document;
try {
document = (MaintenanceDocument) documentService.getByDocumentHeaderId(documentHeader.getDocumentNumber());
CheckReconciliation oldCr = (CheckReconciliation) document.getOldMaintainableObject().getBusinessObject();
CheckReconciliation newCr = (CheckReconciliation) document.getNewMaintainableObject().getBusinessObject();
if (ObjectUtils.isNotNull(oldCr) && !oldCr.getStatus().equalsIgnoreCase(newCr.getStatus())) {
Date currentDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();
newCr.setStatusChangeDate(currentDate);
// KFSUPGRADE-377
if (CRConstants.CANCELLED.equalsIgnoreCase(newCr.getStatus())) {
newCr.setCancelDocHdrId(documentHeader.getDocumentNumber());
}
}
} catch (WorkflowException e) {
throw new RuntimeCacheException(e);
}
}
}
Aggregations