1 /**
2 * Copyright 2005-2014 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.rice.kew.document;
17
18 import org.kuali.rice.kew.rule.RuleBaseValues;
19 import org.kuali.rice.kew.rule.RuleDelegationBo;
20 import org.kuali.rice.kns.document.MaintenanceDocument;
21
22 /**
23 * This is a description of what this class does - Garey don't forget to fill this in.
24 *
25 * @author Kuali Rice Team (rice.collab@kuali.org)
26 *
27 */
28 public class RoutingRuleDelegationMaintainableBusRule extends RoutingRuleMaintainableBusRule
29 {
30
31 // Name of the section in the xml file.
32 protected static final String PERSON_RESP_SECTION = "delegationRule.personResponsibilities";
33 // Name of the section in the xml file.
34 protected static final String GROUP_RESP_SECTION = "delegationRule.groupResponsibilities";
35
36 /**
37 * Returns the new RuleBaseValues business object. Overrides the base
38 * class method. This business object has a different location
39 * of the RuleBaseValues.
40 */
41 protected RuleBaseValues getRuleBaseValues(MaintenanceDocument document) {
42 return this.getBusObject(document).getDelegationRule();
43 }
44
45 protected RuleDelegationBo getBusObject(MaintenanceDocument document){
46 return (RuleDelegationBo)document.getNewMaintainableObject().getBusinessObject();
47 }
48
49 /**
50 * Returns the old RuleBaseValues business object. Overrides the base
51 * class method. This business object has a different location
52 * of the RuleBaseValues.
53 */
54 protected RuleBaseValues getOldRuleBaseValues(MaintenanceDocument document) {
55 return this.getOldBusObject(document).getDelegationRule();
56 }
57
58 protected RuleDelegationBo getOldBusObject(MaintenanceDocument document){
59 return (RuleDelegationBo)document.getOldMaintainableObject().getBusinessObject();
60 }
61
62 /**
63 * This overridden method returns the person section name for the delegation doc
64 *
65 * @see org.kuali.rice.kew.document.RoutingRuleMaintainableBusRule#getPersonSectionName()
66 */
67 @Override
68 protected String getPersonSectionName() {
69 return PERSON_RESP_SECTION;
70 }
71
72 /**
73 * This overridden method returns the group section name for the delegation doc
74 *
75 * @see org.kuali.rice.kew.document.RoutingRuleMaintainableBusRule#getGroupSectionName()
76 */
77 @Override
78 protected String getGroupSectionName() {
79 return GROUP_RESP_SECTION;
80 }
81
82 }