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

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.coa.document.validation.impl.ObjectCodeRule
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 ObjectCodeRule
extends org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase

This class implements the business rules for ObjectCode


Field Summary
protected static ChartService chartService
           
protected static org.kuali.rice.kns.service.KualiConfigurationService configService
           
protected static ObjectCodeService objectCodeService
           
protected static ObjectConsService objectConsService
           
protected static ObjectLevelService objectLevelService
           
protected  Map reportsTo
           
 
Fields inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
boDictionaryService, boService, businessObjectAuthorizationService, ddService, dictionaryValidationService, DOCUMENT_ERROR_PREFIX, documentHelperService, LOG, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, personService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
ObjectCodeRule()
          Constructs a ObjectCodeRule Pseudo-injects some services as well as fills out the reports to chart hierarchy
 
Method Summary
protected  boolean checkForBlockingIndirectCostRecoveryExclusionAccounts(ObjectCode objectCode)
          Checks that no ICR Exclusion by Account records are dependent on the given object code if it is inactivated
protected  boolean checkForBlockingOffsetDefinitions(ObjectCode objectCode)
          Checks that no offset definitions are dependent on the given object code if it is inactivated
 boolean consolidationTableDoesNotHave(String chartCode, String objectCode)
          This Check whether newly added object code already exists in Consolidation table
protected  boolean denied(List set, Object value)
          This method is a null-safe wrapper around Set.contains()
protected  boolean isLegalBudgetAggregationCode(String budgetAggregationCode)
          Budget Aggregation Code (fobj_bdgt_aggr_cd) must have an institutionally specified value
protected  boolean isObjectCodeInactivating(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          Determines if the given maintenance document constitutes an inactivation of the object code it is maintaining
 boolean isValidYear(Integer year)
          Deprecated. 
 boolean nextYearObjectCodeDoesNotExistThisYear(Integer year, String chartCode, String objCode)
          This checks to see if the next year object code already exists in the next fiscal year
 boolean objectLevelTableDoesNotHave(String chartCode, String objectCode)
          This method checks whether newly added object code already exists in Object Level table
protected  boolean permitted(Set set, Object value)
          This method is a null-safe wrapper around Set.contains().
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This method calls the following rules on document route: processObjectCodeRules(ObjectCode)
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This method calls the following rules on document save: processObjectCodeRules(ObjectCode) It does not fail if rules fail
protected  boolean processObjectCodeRules(ObjectCode objectCode)
          This checks the following rules: object code valid reports to chart code is valid (similar to what ObjectCodePreRules does) is the budget aggregation code valid then checks to make sure that this object code hasn't already been entered in the consolidation and level table finally checks to make sure that the next year object code (if filled out) isn't already in there and that this object code has a valid fiscal year
protected  boolean verifyObjectCode(Integer year, String chart, String objectCode)
          This checks to see if the object code already exists in the system
protected  boolean verifyReportsToChartCode(Integer year, String chart, String objectCode, String reportsToChartCode, String reportsToObjectCode)
          This method checks When the value of reportsToChartCode does not have an institutional exception, the Reports to Object (rpts_to_fin_obj_cd) fiscal year, and chart code must exist in the object code table if the chart and object are the same, then skip the check this assumes that the validity of the reports-to object code has already been tested (and corrected if necessary)
 
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, 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
 

Field Detail

objectLevelService

protected static ObjectLevelService objectLevelService

objectCodeService

protected static ObjectCodeService objectCodeService

objectConsService

protected static ObjectConsService objectConsService

configService

protected static org.kuali.rice.kns.service.KualiConfigurationService configService

chartService

protected static ChartService chartService

reportsTo

protected Map reportsTo
Constructor Detail

ObjectCodeRule

public ObjectCodeRule()
Constructs a ObjectCodeRule Pseudo-injects some services as well as fills out the reports to chart hierarchy

Method Detail

processCustomSaveDocumentBusinessRules

protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This method calls the following rules on document save: It does not fail if rules fail

Overrides:
processCustomSaveDocumentBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
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 on document route:

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

processObjectCodeRules

protected boolean processObjectCodeRules(ObjectCode objectCode)
This checks the following rules:

Parameters:
objectCode -
Returns:

objectLevelTableDoesNotHave

public boolean objectLevelTableDoesNotHave(String chartCode,
                                           String objectCode)
This method checks whether newly added object code already exists in Object Level table

Parameters:
chartCode -
objectCode -
Returns:
false if this object code already exists in the object level table

consolidationTableDoesNotHave

public boolean consolidationTableDoesNotHave(String chartCode,
                                             String objectCode)
This Check whether newly added object code already exists in Consolidation table

Parameters:
chartCode -
objectCode -
Returns:
false if this object code already exists in the object consolidation table

nextYearObjectCodeDoesNotExistThisYear

public boolean nextYearObjectCodeDoesNotExistThisYear(Integer year,
                                                      String chartCode,
                                                      String objCode)
This checks to see if the next year object code already exists in the next fiscal year

Parameters:
year -
chartCode -
objCode -
Returns:
false if this object code exists in the next fiscal year

isValidYear

@Deprecated
public boolean isValidYear(Integer year)
Deprecated. 

This checks to make sure the fiscal year they are trying to assign is valid

Parameters:
year -
Returns:
true if this is a valid year

permitted

protected boolean permitted(Set set,
                            Object value)
This method is a null-safe wrapper around Set.contains().

Parameters:
set - - methods returns false if the Set is null
value - to seek
Returns:
true iff Set exists and contains given value

denied

protected boolean denied(List set,
                         Object value)
This method is a null-safe wrapper around Set.contains()

Parameters:
set -
value -
Returns:
true if this value is not contained in the Set or Set is null

isLegalBudgetAggregationCode

protected boolean isLegalBudgetAggregationCode(String budgetAggregationCode)
Budget Aggregation Code (fobj_bdgt_aggr_cd) must have an institutionally specified value

Parameters:
budgetAggregationCode -
Returns:
true if this is a legal budget aggregation code

verifyObjectCode

protected boolean verifyObjectCode(Integer year,
                                   String chart,
                                   String objectCode)
This checks to see if the object code already exists in the system

Parameters:
year -
chart -
objectCode -
Returns:
true if it exists

verifyReportsToChartCode

protected boolean verifyReportsToChartCode(Integer year,
                                           String chart,
                                           String objectCode,
                                           String reportsToChartCode,
                                           String reportsToObjectCode)
This method checks When the value of reportsToChartCode does not have an institutional exception, the Reports to Object (rpts_to_fin_obj_cd) fiscal year, and chart code must exist in the object code table if the chart and object are the same, then skip the check this assumes that the validity of the reports-to object code has already been tested (and corrected if necessary)

Parameters:
year -
chart -
objectCode -
reportsToChartCode -
reportsToObjectCode -
Returns:
true if the object code's reports to chart and chart are the same and reports to object and object code are the same or if the object code already exists

isObjectCodeInactivating

protected boolean isObjectCodeInactivating(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Determines if the given maintenance document constitutes an inactivation of the object code it is maintaining

Parameters:
maintenanceDocument - the maintenance document maintaining an object code
Returns:
true if the document is inactivating the object code, false otherwise

checkForBlockingOffsetDefinitions

protected boolean checkForBlockingOffsetDefinitions(ObjectCode objectCode)
Checks that no offset definitions are dependent on the given object code if it is inactivated

Parameters:
objectCode - the object code trying to inactivate
Returns:
true if no offset definitions rely on the object code, false otherwise; this method also inserts error statements

checkForBlockingIndirectCostRecoveryExclusionAccounts

protected boolean checkForBlockingIndirectCostRecoveryExclusionAccounts(ObjectCode objectCode)
Checks that no ICR Exclusion by Account records are dependent on the given object code if it is inactivated

Parameters:
objectCode - the object code trying to inactivate
Returns:
if no ICR Exclusion by Account records rely on the object code, false otherwise; this method also inserts error statements


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