University of Arizona
Dashboard > Kuali Implementation Technical Team > ... > Technical Specifications > Sub-Fund Object Sub-Type Parameter Technical Specification
Site Search:

View Attachments (0) Info

Sub-Fund Object Sub-Type Parameter Technical Specification

Jira Tasks

Revision History

Version Date User Description
1.0 04/24/2009 Heather Lo Initial Spec
1.1 04/27/2009 Heather Lo Second Draft of Spec
1.2 04/29/2009 Heather Lo Third Draft of Spec
2.0 05/06/2009 Heather Lo Spec with Development Steps Taken
2.1 05/11/2009 Heather Lo Spec with Development Steps Taken + Code Examples

Technical Description

A system parameter needs to be added so that users can restrict the use of specific object sub-types (i.e. codes) from being used with specific sub-fund groups on accounting documents. This involves modifying delivered/core code related to accounting validation and document data dictionary files.

Details

  • Database Requirements
    1. Re-use delivered parameters INVALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP and VALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP to apply to all accounting docs.
  • UI Design
    1. Display error message if the object sub-type cannot be associated with a specified sub-fund account.
  • Development Checklist
    1. Create system parameters.
    2. Create a java class to define business logic to check the system parameter.
    3. Copy and modify DisbursementVoucherAccountingLineValidation.java.
      • Extend the delivered version.
      • Modify the validate method.
      • Remove the validateObjectCode method.
    4. Copy and modify FinancialSystemValidators.xml to have an AZ version.
      • Add a bean called AccountingDocument-ObjectSubTypeNotAllowedValidation that references new validation java class.
        • See bean from DisbursementVoucher-accountingLineValidation in FinancialProcessingValidators.xml for an example.
      • Modify/override the AccountingDocument-defaultAccountingLineValuesAllowedValidation to add the new check (AccountingDocument-ObjectSubTypeNotAllowedValidation).
    5. Copy and modify AccountingLineValuesAllowedValidationHutch.java.
      • Extend the delivered version.
      • Include the new validation.
    6. Modify edu/arizona/kfs/fp/spring-fp.xml to import our FinancialSystemValidators.xml.
    7. Test.

Development Steps Completed

  1. Created system parameters.
    • Took INVALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP & VALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP declaration from DisbursementVoucherConstants.java and added to edu/arizona/kfs/sys/AZKFSConstants.java.
    • Wrote SQL statement to create the system parameters with specified values and added to work/db/scripts/arizona/data.sql.
  2. Created a java class to define business logic to check the system parameters.
    • Created edu/arizona/kfs/sys/document/validation/impl/AccountingLineObjectSubTypeSubFundValidation.java.
      • Extended AccountingLineValueAllowedValidation.
      • Copied and modified the validate and validateObjectCode methods from DisbursementVoucherAccountingLineValidation.java.
      • Copied other methods related to the validation methods.
        excerpt from edu/arizona/kfs/sys/document/validation/impl/AccountingLineObjectSubTypeSubFundValidation.java
        public class AccountingLineObjectSubTypeSubFundValidation extends AccountingLineValueAllowedValidation {
        .
        . // variable declarations
        .
            /**
             * @see org.kuali.kfs.sys.document.validation.Validation#validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)
             */
            public boolean validate(AttributedDocumentEvent event) {
                LOG.debug("validate start");
        
                boolean valid = true;
                ErrorMap errors = GlobalVariables.getErrorMap();
        
                valid = validateObjectCode(accountingDocumentForValidation, accountingLineForValidation);
        
                return valid;
            }
            
            /**
             * Checks object codes restrictions, including restrictions in parameters table.
             * 
             * @param FinancialDocument submitted accounting document
             * @param accountingLine accounting line in accounting document
             * @return true if object code is allowed, given the account's sub fund
             */
            public boolean validateObjectCode(AccountingDocument financialDocument, AccountingLine accountingLine) {
                LOG.debug("beginning object code validation ");
        
                boolean objectCodeAllowed = true;
        
                objectCodeAllowed = objectCodeAllowed && parameterService.getParameterEvaluator(KfsParameterConstants.FINANCIAL_SYSTEM_DOCUMENT.class, AZKFSConstants.VALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP_PARM, AZKFSConstants.INVALID_OBJECT_SUB_TYPES_BY_SUB_FUND_GROUP_PARM, accountingLine.getAccount().getSubFundGroupCode(), accountingLine.getObjectCode().getFinancialObjectSubTypeCode()).evaluateAndAddError(SourceAccountingLine.class, "objectCode.financialObjectSubTypeCode", KFSPropertyConstants.FINANCIAL_OBJECT_CODE);
        
                return objectCodeAllowed;
            }
        .
        . // getter and setter methods
        .
        }
  3. Copied and modified DisbursementVoucherAccountingLineValidation.java.
    • Created edu/arizona/kfs/fp/document/validation/impl/DisbursementVoucherAccountingLineValidation.java.
      • Extended the delivered version.
      • Modified the validateObjectCode method.
      • Removed other methods.
  4. Copied and modified FinancialSystemValidators.xml to make edu/arizona/kfs/sys/document/validation/configuration/FinancialSystemValidators.xml.
    • Added a bean called AccountingDocument-ObjectSubTypeNotAllowedValidation that references AccountingLineObjectSubTypeSubFundValidation.java.
    • Overrode the AccountingDocument-defaultAccountingLineValuesAllowedValidation to add the new check (AccountingDocument-ObjectSubTypeNotAllowedValidation).
      excerpt from edu/arizona/kfs/sys/document/validation/configuration/FinancialSystemValidators.xml
      <bean id="AccountingDocument-defaultAccountingLineValuesAllowedValidation" class="edu.arizona.kfs.sys.document.validation.impl.AccountingLineValuesAllowedValidationHutch" abstract="true">
      	<property name="objectCodeAllowedValidation" ref="AccountingDocument-IsObjectCodeAllowed-DefaultValidation" />
      	<property name="objectTypeAllowedValidation" ref="AccountingDocument-IsObjectTypeAllowed-DefaultValidation" />
      	<property name="fundGroupAllowedValidation" ref="AccountingDocument-IsFundGroupAllowed-DefaultValidation" />
      	<property name="subFundGroupAllowedValidation" ref="AccountingDocument-IsSubFundGroupAllowed-DefaultValidation" />
      	<property name="objectSubTypeAllowedValidation" ref="AccountingDocument-IsObjectSubTypeAllowed-DefaultValidation" />
      	<property name="objectLevelAllowedValidation" ref="AccountingDocument-IsObjectLevelAllowed-DefaultValidation" />
      	<property name="objectConsolidationAllowedValidation" ref="AccountingDocument-IsObjectConsolidationAllowed-DefaultValidation" />
      	<!-- KITT-296 -->
      	<property name="subTypeSubFundGroupValidation" ref="AccountingDocument-ObjectSubTypeNotAllowedValidation" />
      </bean>
      	
      <!-- KITT-296 -->
      <bean id="AccountingDocument-ObjectSubTypeNotAllowedValidation" scope="prototype" parent="AccountingDocument-ObjectSubTypeNotAllowedValidation-parentBean" />
      
      <bean id="AccountingDocument-ObjectSubTypeNotAllowedValidation-parentBean" class="edu.arizona.kfs.sys.document.validation.impl.AccountingLineObjectSubTypeSubFundValidation" abstract="true">
      	<property name="parameterService" ref="parameterService" />
      </bean>
  5. Copied and modified AccountingLineValuesAllowedValidationHutch.java to include the new validation.
    • Extended the delivered version.
    • Included the new validation.
  6. Modified edu/arizona/kfs/fp/spring-sys.xml to import our FinancialSystemValidators.xml.

View a printable version of the current page.

Browse Space
- Pages
- Labels
- Attachments
- Mail
- Bookmarks
- News
- Activity
- Advanced

Explore Confluence
- Popular Labels
- Notation Guide

Your Account
Log In

 

Add Content


Powered by Atlassian Confluence 1115, the Enterprise Wiki.. Contact administrators.