org.kuali.kfs.coa.document.validation.impl
Class GlobalDocumentRuleBase

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.GlobalDocumentRuleBase
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
Direct Known Subclasses:
AccountGlobalRule, DelegateGlobalRule, OrganizationReversionGlobalRule, SubObjCdGlobalRule

public class GlobalDocumentRuleBase
extends KfsMaintenanceDocumentRuleBase

This class contains common Business Rule functionality for Global Documents.


Nested Class Summary
protected  class GlobalDocumentRuleBase.CheckOnlyOneChartResult
          This class is used internally to represent the result of the CheckOnlyOneChart method.
 
Field Summary
 
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, LOG, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
GlobalDocumentRuleBase()
          Constructs a GlobalDocumentRuleBase.java.
 
Method Summary
protected  GlobalDocumentRuleBase.CheckOnlyOneChartResult checkOnlyOneChart(List<AccountGlobalDetail> accountGlobalDetails)
          This method checks whether the set of Account Change Detail records on this document all are under the same Chart of Accounts.
protected  boolean checkOnlyOneChartAddLine(AccountGlobalDetail newAccountLine, List<AccountGlobalDetail> accountGlobalDetails)
          This method tests whether a new line can be added, based on the rule that says all the accounts being used must belong to the same chart.
protected  boolean checkOnlyOneChartAddLineErrorWrapper(AccountGlobalDetail newAccountLine, List<AccountGlobalDetail> accountGlobalDetails)
          This method tests whether the line being added has a different Chart of Accounts Code from any of the existing lines.
protected  boolean checkOnlyOneChartErrorWrapper(List<AccountGlobalDetail> accountGlobalDetails)
          This method checks whether the set of Account Change Detail records on this document all are under the same Chart of Accounts.
 
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, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, 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, setupConvenienceObjects, 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
 

Constructor Detail

GlobalDocumentRuleBase

public GlobalDocumentRuleBase()
Constructs a GlobalDocumentRuleBase.java.

Method Detail

checkOnlyOneChartErrorWrapper

protected boolean checkOnlyOneChartErrorWrapper(List<AccountGlobalDetail> accountGlobalDetails)
This method checks whether the set of Account Change Detail records on this document all are under the same Chart of Accounts. It will set the appropriate field error if it did fail, and return the result.

Parameters:
accountGlobalDetails -
Returns:
True if the test passed with no errors, False if any errors occurred.

checkOnlyOneChart

protected GlobalDocumentRuleBase.CheckOnlyOneChartResult checkOnlyOneChart(List<AccountGlobalDetail> accountGlobalDetails)
This method checks whether the set of Account Change Detail records on this document all are under the same Chart of Accounts. It will return a failed CheckOnlyOneChartResult if so. Note that this method doesnt actually set any errors, it just returns whether or not the test succeeded, and where it failed if it failed.

Parameters:
accountGlobalDetails - The popualted accountGlobalDocument to test.
Returns:
A populated CheckOnlyOneChartResult object. This will contain whether the test succeeded or failed, and if failed, what lines the failures occurred on.

checkOnlyOneChartAddLineErrorWrapper

protected boolean checkOnlyOneChartAddLineErrorWrapper(AccountGlobalDetail newAccountLine,
                                                       List<AccountGlobalDetail> accountGlobalDetails)
This method tests whether the line being added has a different Chart of Accounts Code from any of the existing lines. It will set an Error and return false if this is the case.

Parameters:
newAccountLine -
accountGlobalDetails -
Returns:
True if the line being added has the exact same chart as all the existing lines, False if not.

checkOnlyOneChartAddLine

protected boolean checkOnlyOneChartAddLine(AccountGlobalDetail newAccountLine,
                                           List<AccountGlobalDetail> accountGlobalDetails)
This method tests whether a new line can be added, based on the rule that says all the accounts being used must belong to the same chart. If the line being added differs from any existing line's Chart code, it will return false. Note that this document does not actually set any errors, it just reports success or failure.

Parameters:
newAccountLine -
accountGlobalDetails -
Returns:
True if no errors are found, False if the line being added has a different Chart code than any of the existing lines.


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