Search in sources :

Example 1 with ContractsAndGrantsCfda

use of org.kuali.kfs.integration.cg.ContractsAndGrantsCfda in project cu-kfs by CU-CommunityApps.

the class AccountGlobalRule method checkCfda.

private boolean checkCfda(String accountCfdaNumber) {
    boolean success = true;
    ContractsAndGrantsCfda cfda = null;
    if (!StringUtils.isEmpty(accountCfdaNumber)) {
        ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(ContractsAndGrantsCfda.class);
        if (moduleService != null) {
            Map<String, Object> keys = new HashMap<String, Object>(1);
            keys.put(KFSPropertyConstants.CFDA_NUMBER, accountCfdaNumber);
            cfda = moduleService.getExternalizableBusinessObject(ContractsAndGrantsCfda.class, keys);
        } else {
            throw new RuntimeException("CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed.");
        }
        success = (ObjectUtils.isNull(cfda)) ? false : true;
        if (!success) {
            putFieldError(KFSPropertyConstants.CATALOG_OF_DOMESTIC_ASSISTANCE_NUMBER, KFSKeyConstants.ERROR_DOCUMENT_GLOBAL_ACCOUNT_CFDA_NUMBER_INVALID);
        }
    }
    return success;
}
Also used : KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ContractsAndGrantsModuleService(org.kuali.kfs.integration.cg.ContractsAndGrantsModuleService) LaborModuleService(org.kuali.kfs.integration.ld.LaborModuleService) KualiModuleService(org.kuali.kfs.krad.service.KualiModuleService) ModuleService(org.kuali.kfs.krad.service.ModuleService) ContractsAndGrantsCfda(org.kuali.kfs.integration.cg.ContractsAndGrantsCfda) HashMap(java.util.HashMap) BusinessObject(org.kuali.rice.krad.bo.BusinessObject) PersistableBusinessObject(org.kuali.kfs.krad.bo.PersistableBusinessObject)

Aggregations

HashMap (java.util.HashMap)1 ContractsAndGrantsCfda (org.kuali.kfs.integration.cg.ContractsAndGrantsCfda)1 ContractsAndGrantsModuleService (org.kuali.kfs.integration.cg.ContractsAndGrantsModuleService)1 LaborModuleService (org.kuali.kfs.integration.ld.LaborModuleService)1 PersistableBusinessObject (org.kuali.kfs.krad.bo.PersistableBusinessObject)1 KualiModuleService (org.kuali.kfs.krad.service.KualiModuleService)1 ModuleService (org.kuali.kfs.krad.service.ModuleService)1 BusinessObject (org.kuali.rice.krad.bo.BusinessObject)1