org.kuali.kfs.module.external.kc.document.validation.impl
Class AccountAutoCreateDefaultsRule

java.lang.Object
  extended by org.kuali.rice.kns.rules.DocumentRuleBase
      extended by org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
          extended by org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
              extended by org.kuali.kfs.coa.document.validation.impl.AccountRule
                  extended by org.kuali.kfs.module.external.kc.document.validation.impl.AccountAutoCreateDefaultsRule
All Implemented Interfaces:
org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule, org.kuali.rice.kns.rule.AddAdHocRoutePersonRule, org.kuali.rice.kns.rule.AddAdHocRouteWorkgroupRule, org.kuali.rice.kns.rule.AddCollectionLineRule, org.kuali.rice.kns.rule.AddNoteRule, org.kuali.rice.kns.rule.ApproveDocumentRule, org.kuali.rice.kns.rule.BusinessRule, org.kuali.rice.kns.rule.RouteDocumentRule, org.kuali.rice.kns.rule.SaveDocumentRule, org.kuali.rice.kns.rule.SendAdHocRequestsRule

public class AccountAutoCreateDefaultsRule
extends AccountRule

Business rule(s) applicable to AccountMaintenance documents.


Field Summary
protected  AccountService accountService
           
protected  ContractsAndGrantsModuleService contractsAndGrantsModuleService
           
protected static org.apache.log4j.Logger LOG
           
protected  AccountAutoCreateDefaults newAccountAutoCreateDefaults
           
protected  AccountAutoCreateDefaults oldAccountAutoCreateDefaults
           
protected static org.kuali.rice.kns.service.ParameterService parameterService
           
 
Fields inherited from class org.kuali.kfs.coa.document.validation.impl.AccountRule
ACCT_CAPITAL_SUBFUNDGROUP, ACCT_PREFIX_RESTRICTION, balanceService, BUDGET_RECORDING_LEVEL_MIXED, ENDOWMENT_FUND_CD, GENERAL_FUND_CD, generalLedgerPendingEntryService, newAccount, oldAccount, PLANT_FUND_CD, RESTRICTED_CD_RESTRICTED, RESTRICTED_CD_TEMPORARILY_RESTRICTED, RESTRICTED_CD_UNRESTRICTED, RESTRICTED_FUND_CD, subFundGroupService
 
Fields inherited from class org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
financialSystemUserService, personService
 
Fields inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
boDictionaryService, boService, businessObjectAuthorizationService, configService, ddService, dictionaryValidationService, DOCUMENT_ERROR_PREFIX, documentHelperService, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
AccountAutoCreateDefaultsRule()
           
 
Method Summary
protected  boolean checkCGFieldNotFilledIn(String propertyName)
           
protected  boolean checkCgRequiredFields()
           
protected  boolean checkContractsAndGrants(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          This method checks to see if any Contracts and Grants business rules were violated Calls the following sub-rules: checkCgRequiredFields checkCgIncomeStreamRequired
protected  boolean checkEmptyValues(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          This method checks the basic rules for empty values in an account and associated objects with this account If guidelines are required for this Business Object it checks to make sure that it is filled out It also checks for partially filled out reference keys on the following: continuationAccount incomeStreamAccount endowmentIncomeAccount reportsToAccount contractControlAccount indirectCostRecoveryAcct
protected  boolean checkFringeBenefitAccountRule()
           
protected  boolean checkGeneralRules(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          This method checks some of the general business rules associated with this document Calls the following rules: accountNumberStartsWithAllowedPrefix isNonSystemSupervisorEditingAClosedAccount hasTemporaryRestrictedStatusCodeButNoRestrictedStatusDate checkFringeBenefitAccountRule checkUserStatusAndType (on fiscal officer, supervisor and manager) ensures that the fiscal officer, supervisor and manager are not the same isContinuationAccountExpired
protected  boolean checkIncomeStreamAccountRule()
          the income stream account is required if account's sub fund group code's fund group code is either GF or CG.
protected  boolean checkIncomeStreamValid()
           
protected  boolean checkRequiredKcUnit(AccountAutoCreateDefaults newAccountAutoCreateDefaults, boolean isNew)
          This method checks to make sure that the kcUnit field exists and is entered correctly
 org.kuali.rice.kns.service.ParameterService getParameterService()
           
protected  boolean isContinuationAccountExpired()
           
protected  boolean isSupervisorSameAsFiscalOfficer()
           
protected  boolean isSupervisorSameAsManager()
           
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This method calls the following rules: checkAccountGuidelinesValidation checkEmptyValues checkGeneralRules checkCloseAccount checkContractsAndGrants checkExpirationDate checkFundGroup checkSubFundGroup checkFiscalOfficerIsValidKualiUser this rule will fail on routing
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This method calls the route rules but does not fail if any of them fail (this only happens on routing)
 void setContractsAndGrantsModuleService(ContractsAndGrantsModuleService contractsAndGrantsModuleService)
          Sets the contractsAndGrantsModuleService attribute value.
 void setupConvenienceObjects()
          This method sets the convenience objects like newAccountAutoCreateDefaults and oldAccountAutoCreateDefaults, so you have short and easy handles to the new and old objects contained in the maintenance document.
 
Methods inherited from class org.kuali.kfs.coa.document.validation.impl.AccountRule
accountNumberStartsWithAllowedPrefix, areGuidelinesRequired, areTwoUsersTheSame, checkAccountExpirationDateValidTodayOrEarlier, checkAccountGuidelinesValidation, checkCGFieldNotFilledIn, checkCgRequiredFields, checkCloseAccount, checkContractControlAccountNumberRequired, checkExpirationDate, checkFringeBenefitAccountRule, checkFundGroup, checkIncomeStreamValid, checkSubFundGroup, checkUniqueAccountNumber, getSubFundGroupService, hasDefaultRestrictedStatusCode, hasTemporaryRestrictedStatusCodeButNoRestrictedStatusDate, isContinuationAccountExpired, isNonSystemSupervisorEditingAClosedAccount, isSupervisorSameAsFiscalOfficer, isSupervisorSameAsManager, isUpdatedExpirationDateInvalid, replaceTokens, setAccountService, setBalanceService, setGeneralLedgerPendingEntryService
 
Methods inherited from class org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
getFinancialSystemUserService, getKfsUserService
 
Methods inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
apcRuleFails, applyApcRule, checkEmptyBOField, checkEmptyDocumentField, checkEmptyValue, checkForPartiallyFilledOutReferenceForeignKeys, clearErrorPath, consolidateFieldNames, dataDictionaryValidate, errorAlreadyExists, getBoDictionaryService, getBoService, getBusinessObjectAuthorizationService, getConfigService, getDateTimeService, getDdService, getDictionaryValidationService, getDocumentHelperService, getFieldLabel, getFieldLabel, getHumanReadablePrimaryKeyFieldNames, getMaintDocDictionaryService, getNewBo, getOldBo, getPersistenceService, getPersistenceStructureService, getPersonService, getRoleService, getWorkflowDocumentService, isCorrectMaintenanceClass, isDocumentInactivatingBusinessObject, isDocumentValidForSave, primaryKeyCheck, processAddCollectionLineBusinessRules, processApproveDocument, processCustomAddCollectionLineBusinessRules, processCustomApproveDocumentBusinessRules, processGlobalApproveDocumentBusinessRules, processGlobalRouteDocumentBusinessRules, processGlobalSaveDocumentBusinessRules, processInactivationBlockChecking, processInactivationBlockChecking, processRouteDocument, processSaveDocument, putDocumentError, putDocumentError, putFieldError, putFieldError, putFieldError, putFieldErrorWithShortLabel, putGlobalError, putGlobalError, putGlobalError, putGlobalsError, putGlobalsError, putInactivationBlockingErrorOnPage, resumeErrorPath, setBoDictionaryService, setBoService, setBusinessObjectAuthorizationService, setConfigService, setDdService, setDictionaryValidationService, setDocumentHelperService, setMaintDocDictionaryService, setNewBo, setPersistenceService, setPersistenceStructureService, setPersonService, setupBaseConvenienceObjects, setWorkflowDocumentService, showErrorMap, validateDocumentStructure, validateDuplicateIdentifierInDataDictionary, validateGlobalBusinessObjectPersistable, validateMaintenanceDocument
 
Methods inherited from class org.kuali.rice.kns.rules.DocumentRuleBase
getDataDictionaryService, getIdentityManagementService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getWorkflowInfoService, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddNote, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, processCustomSendAdHocRequests, processSendAdHocRequests, setMaxDictionaryValidationDepth, validateSensitiveDataValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

parameterService

protected static org.kuali.rice.kns.service.ParameterService parameterService

accountService

protected AccountService accountService

contractsAndGrantsModuleService

protected ContractsAndGrantsModuleService contractsAndGrantsModuleService

oldAccountAutoCreateDefaults

protected AccountAutoCreateDefaults oldAccountAutoCreateDefaults

newAccountAutoCreateDefaults

protected AccountAutoCreateDefaults newAccountAutoCreateDefaults
Constructor Detail

AccountAutoCreateDefaultsRule

public AccountAutoCreateDefaultsRule()
Method Detail

setupConvenienceObjects

public void setupConvenienceObjects()
This method sets the convenience objects like newAccountAutoCreateDefaults and oldAccountAutoCreateDefaults, so you have short and easy handles to the new and old objects contained in the maintenance document. It also calls the BusinessObjectBase.refresh(), which will attempt to load all sub-objects from the DB by their primary keys, if available.

Specified by:
setupConvenienceObjects in interface org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule
Overrides:
setupConvenienceObjects in class AccountRule

processCustomSaveDocumentBusinessRules

protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This method calls the route rules but does not fail if any of them fail (this only happens on routing)

Overrides:
processCustomSaveDocumentBusinessRules in class AccountRule
See Also:
MaintenanceDocumentRuleBase.processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)

processCustomRouteDocumentBusinessRules

protected boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This method calls the following rules: checkAccountGuidelinesValidation checkEmptyValues checkGeneralRules checkCloseAccount checkContractsAndGrants checkExpirationDate checkFundGroup checkSubFundGroup checkFiscalOfficerIsValidKualiUser this rule will fail on routing

Overrides:
processCustomRouteDocumentBusinessRules in class AccountRule
See Also:
MaintenanceDocumentRuleBase.processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)

checkEmptyValues

protected boolean checkEmptyValues(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Description copied from class: AccountRule
This method checks the basic rules for empty values in an account and associated objects with this account If guidelines are required for this Business Object it checks to make sure that it is filled out It also checks for partially filled out reference keys on the following: continuationAccount incomeStreamAccount endowmentIncomeAccount reportsToAccount contractControlAccount indirectCostRecoveryAcct

Overrides:
checkEmptyValues in class AccountRule
Returns:
false if any of these are empty

checkGeneralRules

protected boolean checkGeneralRules(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Description copied from class: AccountRule
This method checks some of the general business rules associated with this document Calls the following rules: accountNumberStartsWithAllowedPrefix isNonSystemSupervisorEditingAClosedAccount hasTemporaryRestrictedStatusCodeButNoRestrictedStatusDate checkFringeBenefitAccountRule checkUserStatusAndType (on fiscal officer, supervisor and manager) ensures that the fiscal officer, supervisor and manager are not the same isContinuationAccountExpired

Overrides:
checkGeneralRules in class AccountRule
Returns:
false on rules violation

checkFringeBenefitAccountRule

protected boolean checkFringeBenefitAccountRule()

isSupervisorSameAsFiscalOfficer

protected boolean isSupervisorSameAsFiscalOfficer()

isSupervisorSameAsManager

protected boolean isSupervisorSameAsManager()

isContinuationAccountExpired

protected boolean isContinuationAccountExpired()

checkContractsAndGrants

protected boolean checkContractsAndGrants(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Description copied from class: AccountRule
This method checks to see if any Contracts and Grants business rules were violated Calls the following sub-rules: checkCgRequiredFields checkCgIncomeStreamRequired

Overrides:
checkContractsAndGrants in class AccountRule
Returns:
false on rules violation

checkCgRequiredFields

protected boolean checkCgRequiredFields()

checkIncomeStreamValid

protected boolean checkIncomeStreamValid()

checkCGFieldNotFilledIn

protected boolean checkCGFieldNotFilledIn(String propertyName)

checkIncomeStreamAccountRule

protected boolean checkIncomeStreamAccountRule()
Description copied from class: AccountRule
the income stream account is required if account's sub fund group code's fund group code is either GF or CG.

Overrides:
checkIncomeStreamAccountRule in class AccountRule
Returns:
true if fund group code (obtained through sub fund group) is in the system parameter INCOME_STREAM_ACCOUNT_REQUIRING_FUND_GROUPS (values GF;CG) else return false.

checkRequiredKcUnit

protected boolean checkRequiredKcUnit(AccountAutoCreateDefaults newAccountAutoCreateDefaults,
                                      boolean isNew)
This method checks to make sure that the kcUnit field exists and is entered correctly

Parameters:
newAccountAutoCreateDefaults -
Returns:
true/false

setContractsAndGrantsModuleService

public void setContractsAndGrantsModuleService(ContractsAndGrantsModuleService contractsAndGrantsModuleService)
Sets the contractsAndGrantsModuleService attribute value.

Overrides:
setContractsAndGrantsModuleService in class AccountRule
Parameters:
contractsAndGrantsModuleService - The contractsAndGrantsModuleService to set.

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()
Overrides:
getParameterService in class AccountRule


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.