001/** 002 * Copyright 2005-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kew.document; 017 018import org.kuali.rice.kew.rule.RuleBaseValues; 019import org.kuali.rice.kew.rule.RuleDelegationBo; 020import org.kuali.rice.kns.document.MaintenanceDocument; 021 022/** 023 * This is a description of what this class does - Garey don't forget to fill this in. 024 * 025 * @author Kuali Rice Team (rice.collab@kuali.org) 026 * 027 */ 028public class RoutingRuleDelegationMaintainableBusRule extends RoutingRuleMaintainableBusRule 029{ 030 031 // Name of the section in the xml file. 032 protected static final String PERSON_RESP_SECTION = "delegationRule.personResponsibilities"; 033 // Name of the section in the xml file. 034 protected static final String GROUP_RESP_SECTION = "delegationRule.groupResponsibilities"; 035 036 /** 037 * Returns the new RuleBaseValues business object. Overrides the base 038 * class method. This business object has a different location 039 * of the RuleBaseValues. 040 */ 041 protected RuleBaseValues getRuleBaseValues(MaintenanceDocument document) { 042 return this.getBusObject(document).getDelegationRule(); 043 } 044 045 protected RuleDelegationBo getBusObject(MaintenanceDocument document){ 046 return (RuleDelegationBo)document.getNewMaintainableObject().getBusinessObject(); 047 } 048 049 /** 050 * Returns the old RuleBaseValues business object. Overrides the base 051 * class method. This business object has a different location 052 * of the RuleBaseValues. 053 */ 054 protected RuleBaseValues getOldRuleBaseValues(MaintenanceDocument document) { 055 return this.getOldBusObject(document).getDelegationRule(); 056 } 057 058 protected RuleDelegationBo getOldBusObject(MaintenanceDocument document){ 059 return (RuleDelegationBo)document.getOldMaintainableObject().getBusinessObject(); 060 } 061 062 /** 063 * This overridden method returns the person section name for the delegation doc 064 * 065 * @see org.kuali.rice.kew.document.RoutingRuleMaintainableBusRule#getPersonSectionName() 066 */ 067 @Override 068 protected String getPersonSectionName() { 069 return PERSON_RESP_SECTION; 070 } 071 072 /** 073 * This overridden method returns the group section name for the delegation doc 074 * 075 * @see org.kuali.rice.kew.document.RoutingRuleMaintainableBusRule#getGroupSectionName() 076 */ 077 @Override 078 protected String getGroupSectionName() { 079 return GROUP_RESP_SECTION; 080 } 081 082}