org.kuali.kfs.module.cam.document.validation.impl
Class AssetRetirementGlobalRule

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

Business rules applicable to AssetLocationGlobal documents.


Field Summary
protected  org.kuali.rice.kns.bo.PersistableBusinessObject bo
           
protected static org.apache.log4j.Logger LOG
           
 
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, personService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
AssetRetirementGlobalRule()
          Constructs a AssetLocationGlobalRule
 
Method Summary
protected  boolean allPaymentsFederalOwned(AssetRetirementGlobal assetRetirementGlobal)
          Check if all asset payments are federal owned.
protected  boolean assetRetirementValidation(AssetRetirementGlobal assetRetirementGlobal, org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          Validate Asset Retirement Global and Details.
protected  boolean checkRetirementDetailOneLine(AssetRetirementGlobalDetail assetRetirementGlobalDetail, AssetRetirementGlobal assetRetirementGlobal, org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          This method validates one asset is a valid asset and no duplicate with target asset when merge.
protected  boolean checkRetireMultipleAssets(String retirementReasonCode, List<AssetRetirementGlobalDetail> assetRetirementDetails, Integer maxNumber, org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          Check if only single asset is allowed to retire.
protected  AssetObjectCodeService getAssetObjectCodeService()
           
protected  AssetPaymentService getAssetPaymentService()
           
protected  AssetRetirementService getAssetRetirementService()
           
protected  AssetService getAssetService()
           
protected  CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()
           
protected  boolean isDocumentValidForSave(org.kuali.rice.kns.document.MaintenanceDocument document)
          Forces the processing of rules when saving.
 boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document, String collectionName, org.kuali.rice.kns.bo.PersistableBusinessObject line)
           
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
           
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          Processes rules when saving this global.
protected  List<Long> retrieveAssetNumbersForLocking(AssetRetirementGlobal assetRetirementGlobal)
           
protected  boolean setAssetLocks(org.kuali.rice.kns.document.MaintenanceDocument document)
           
 void setupConvenienceObjects()
           
protected  boolean validateActiveCapitalAsset(Asset asset)
          Only active capital equipment can be retired using the asset retirement document.
protected  boolean validateAssetObjectCode(Asset asset, AssetPayment assetPayment)
          Asset Object Code must exist as an active status.
protected  boolean validateAssetOnLoan(Asset asset)
          Validates whether or not asset is on loan status
protected  boolean validateCashReceiptFinancialDocumentNumber(String documentNumber)
          validates Cash Receipt Financial Document Number
protected  boolean validateDuplicateAssetNumber(Long targetAssetNumber, Long sourceAssetNumber)
          Check for Merge Asset, no duplicate capitalAssetNumber between "from" and "to".
protected  boolean validateFinancialObjectCodes(Asset asset, AssetPayment assetPayment)
          Check Financial Object Code for GLPE.
protected  boolean validateFinObjectCodeForGLPosting(String chartOfAccountsCode, String finObjectCode, ObjectCode finObject, String glPostingType)
          check existence and active status for given financial Object Code BO.
protected  boolean validateMergeTargetAsset(AssetRetirementGlobal assetRetirementGlobal)
          Validate mergedTargetCapitalAsset.
protected  boolean validateNonMoveableAsset(Asset asset, org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          User must be in work group CM_SUPER_USERS to retire a non-moveable asset.
protected  boolean validateObjectCodesForGLPosting(AssetRetirementGlobal assetRetirementGlobal)
          Validate Asset Object Codes and Fin Object Codes eligible for GL Posting.
protected  boolean validateRequiredGlobalFields(AssetRetirementGlobal assetRetirementGlobal)
          Validate required fields for given retirement reason code
protected  boolean validateRetirementDetails(AssetRetirementGlobal assetRetirementGlobal, org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          This method validates each asset to be retired.
 
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, primaryKeyCheck, processAddCollectionLineBusinessRules, processApproveDocument, 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

bo

protected org.kuali.rice.kns.bo.PersistableBusinessObject bo
Constructor Detail

AssetRetirementGlobalRule

public AssetRetirementGlobalRule()
Constructs a AssetLocationGlobalRule

Method Detail

setupConvenienceObjects

public void setupConvenienceObjects()
Specified by:
setupConvenienceObjects in interface org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule
Overrides:
setupConvenienceObjects in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.setupConvenienceObjects()

isDocumentValidForSave

protected boolean isDocumentValidForSave(org.kuali.rice.kns.document.MaintenanceDocument document)
Forces the processing of rules when saving.

Overrides:
isDocumentValidForSave in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
Parameters:
document - MaintenanceDocument
Returns:
boolean true when valid; Namely we need to enforce foreign key constraints else processCustomSaveDocumentBusinessRules does not force user back to the document for error correction.
See Also:
MaintenanceDocumentRuleBase.isDocumentValidForSave(org.kuali.rice.kns.document.MaintenanceDocument)

processCustomSaveDocumentBusinessRules

protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
Processes rules when saving this global.

Overrides:
processCustomSaveDocumentBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
Parameters:
document - MaintenanceDocument type of document to be processed.
Returns:
boolean true when success
See Also:
MaintenanceDocumentRuleBase.processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)

retrieveAssetNumbersForLocking

protected List<Long> retrieveAssetNumbersForLocking(AssetRetirementGlobal assetRetirementGlobal)

processCustomRouteDocumentBusinessRules

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

setAssetLocks

protected boolean setAssetLocks(org.kuali.rice.kns.document.MaintenanceDocument document)

getCapitalAssetManagementModuleService

protected CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()

allPaymentsFederalOwned

protected boolean allPaymentsFederalOwned(AssetRetirementGlobal assetRetirementGlobal)
Check if all asset payments are federal owned.

Parameters:
assetRetirementGlobal -
Returns:

validateObjectCodesForGLPosting

protected boolean validateObjectCodesForGLPosting(AssetRetirementGlobal assetRetirementGlobal)
Validate Asset Object Codes and Fin Object Codes eligible for GL Posting.

Parameters:
assetRetirementGlobal -
Returns:

validateFinancialObjectCodes

protected boolean validateFinancialObjectCodes(Asset asset,
                                               AssetPayment assetPayment)
Check Financial Object Code for GLPE.

Parameters:
asset -
assetPayment -
Returns:

validateFinObjectCodeForGLPosting

protected boolean validateFinObjectCodeForGLPosting(String chartOfAccountsCode,
                                                    String finObjectCode,
                                                    ObjectCode finObject,
                                                    String glPostingType)
check existence and active status for given financial Object Code BO.

Parameters:
chartCode -
finObjectCode -
finObject -
Returns:

validateAssetObjectCode

protected boolean validateAssetObjectCode(Asset asset,
                                          AssetPayment assetPayment)
Asset Object Code must exist as an active status.

Parameters:
asset -
assetPayment -
Returns:

processCustomAddCollectionLineBusinessRules

public boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document,
                                                           String collectionName,
                                                           org.kuali.rice.kns.bo.PersistableBusinessObject line)
Overrides:
processCustomAddCollectionLineBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument, java.lang.String, org.kuali.rice.kns.bo.PersistableBusinessObject)

checkRetireMultipleAssets

protected boolean checkRetireMultipleAssets(String retirementReasonCode,
                                            List<AssetRetirementGlobalDetail> assetRetirementDetails,
                                            Integer maxNumber,
                                            org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Check if only single asset is allowed to retire.

Parameters:
retirementReasonCode -
assetRetirementDetails -
maxNumber -
maintenanceDocument -
Returns:

validateRetirementDetails

protected boolean validateRetirementDetails(AssetRetirementGlobal assetRetirementGlobal,
                                            org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method validates each asset to be retired.

Parameters:
assetRetirementGlobalDetails -
maintenanceDocument -
Returns:

checkRetirementDetailOneLine

protected boolean checkRetirementDetailOneLine(AssetRetirementGlobalDetail assetRetirementGlobalDetail,
                                               AssetRetirementGlobal assetRetirementGlobal,
                                               org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
This method validates one asset is a valid asset and no duplicate with target asset when merge.

Parameters:
assetRetirementGlobalDetail -
assetRetirementGlobal -
maintenanceDocument -
Returns:

validateDuplicateAssetNumber

protected boolean validateDuplicateAssetNumber(Long targetAssetNumber,
                                               Long sourceAssetNumber)
Check for Merge Asset, no duplicate capitalAssetNumber between "from" and "to".

Parameters:
targetAssetNumber -
sourceAssetNumber -
Returns:

validateNonMoveableAsset

protected boolean validateNonMoveableAsset(Asset asset,
                                           org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
User must be in work group CM_SUPER_USERS to retire a non-moveable asset.

Parameters:
asset -
maintenanceDocument -
Returns:

assetRetirementValidation

protected boolean assetRetirementValidation(AssetRetirementGlobal assetRetirementGlobal,
                                            org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Validate Asset Retirement Global and Details.

Parameters:
assetRetirementGlobal -
maintenanceDocument -
Returns:

validateMergeTargetAsset

protected boolean validateMergeTargetAsset(AssetRetirementGlobal assetRetirementGlobal)
Validate mergedTargetCapitalAsset. Only valid and active capital asset is allowed.

Parameters:
assetRetirementGlobal -
Returns:

validateActiveCapitalAsset

protected boolean validateActiveCapitalAsset(Asset asset)
Only active capital equipment can be retired using the asset retirement document.

Parameters:
valid -
detail -
Returns:

validateRequiredGlobalFields

protected boolean validateRequiredGlobalFields(AssetRetirementGlobal assetRetirementGlobal)
Validate required fields for given retirement reason code

Parameters:
assetRetirementGlobal -
Returns:

validateCashReceiptFinancialDocumentNumber

protected boolean validateCashReceiptFinancialDocumentNumber(String documentNumber)
validates Cash Receipt Financial Document Number

Parameters:
sharedRetirementInfo -
Returns:
boolean

validateAssetOnLoan

protected boolean validateAssetOnLoan(Asset asset)
Validates whether or not asset is on loan status

Parameters:
assetRetirementGlobalDetail -
Returns:
boolean

getAssetService

protected AssetService getAssetService()

getAssetRetirementService

protected AssetRetirementService getAssetRetirementService()

getAssetPaymentService

protected AssetPaymentService getAssetPaymentService()

getAssetObjectCodeService

protected AssetObjectCodeService getAssetObjectCodeService()


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