Search in sources :

Example 1 with RuntimeCacheException

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);
        }
    }
}
Also used : RuntimeCacheException(org.apache.ojb.broker.cache.RuntimeCacheException) WorkflowDocument(org.kuali.rice.kew.api.WorkflowDocument) MaintenanceDocument(org.kuali.kfs.kns.document.MaintenanceDocument) WorkflowException(org.kuali.rice.kew.api.exception.WorkflowException) CheckReconciliation(com.rsmart.kuali.kfs.cr.businessobject.CheckReconciliation) DateTimeService(org.kuali.rice.core.api.datetime.DateTimeService) DocumentService(org.kuali.kfs.krad.service.DocumentService) Date(java.sql.Date)

Aggregations

CheckReconciliation (com.rsmart.kuali.kfs.cr.businessobject.CheckReconciliation)1 Date (java.sql.Date)1 RuntimeCacheException (org.apache.ojb.broker.cache.RuntimeCacheException)1 MaintenanceDocument (org.kuali.kfs.kns.document.MaintenanceDocument)1 DocumentService (org.kuali.kfs.krad.service.DocumentService)1 DateTimeService (org.kuali.rice.core.api.datetime.DateTimeService)1 WorkflowDocument (org.kuali.rice.kew.api.WorkflowDocument)1 WorkflowException (org.kuali.rice.kew.api.exception.WorkflowException)1