Coverage Report - org.kuali.student.core.atp.document.validation.impl.AtpRule
 
Classes in this File Line Coverage Branch Coverage Complexity
AtpRule
0%
0/5
N/A
1
 
 1  
 /*
 2  
  * Copyright 2006 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.student.core.atp.document.validation.impl;
 17  
 
 18  
 import org.kuali.rice.kns.document.MaintenanceDocument;
 19  
 import org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase;
 20  
 import org.kuali.student.core.atp.bo.Atp;
 21  
 
 22  
 /**
 23  
  * Implements the business rules for {@link Atp} maintenance document
 24  
  */
 25  0
 public class AtpRule extends MaintenanceDocumentRuleBase {
 26  
         protected Atp oldAtp;
 27  
         protected Atp newAtp;
 28  
 
 29  
         /**
 30  
          * Sets the convenience objects like newDefinition and oldDefinition, so you have short and easy handles
 31  
          * to the new and old objects contained in the maintenance document. It also calls the
 32  
          * BusinessObjectBase.refresh(), which will attempt to load all sub-objects from the DB by their primary
 33  
          * keys, if available.
 34  
          * 
 35  
          * @see org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase#setupConvenienceObjects()
 36  
          */
 37  
         @Override
 38  
         public void setupConvenienceObjects() {
 39  
 
 40  
                 // setup oldAccount convenience objects, make sure all possible sub-objects are populated
 41  0
                 oldAtp = (Atp) super.getOldBo();
 42  
 
 43  
                 // setup newAccount convenience objects, make sure all possible sub-objects are populated
 44  0
                 newAtp = (Atp) super.getNewBo();
 45  0
         }
 46  
 
 47  
         /**
 48  
          * Performs rules checks on document route This rule fails on business rule failures
 49  
          * 
 50  
          * @see org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase#processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)
 51  
          */
 52  
         @Override
 53  
         protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {
 54  
                 //        if ((ObjectUtils.isNotNull(newDefinition.getFinancialObject()) && !newDefinition.getFinancialObject().isFinancialObjectActiveCode()) || ObjectUtils.isNull(newDefinition.getFinancialObject())) {
 55  
                 //            putFieldError("financialObjectCode", KFSKeyConstants.ERROR_DOCUMENT_OFFSETDEFMAINT_INACTIVE_OBJ_CODE_FOR_DOCTYPE, new String[] { newDefinition.getFinancialObjectCode(), evaluator.getParameterValuesForMessage() });
 56  
                 //            success &= false;
 57  
                 //        }
 58  
 
 59  0
                 return true;
 60  
         }
 61  
 
 62  
 }