01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.kra.budget.rules.event;
17:
18: import org.kuali.core.document.Document;
19: import org.kuali.core.rule.BusinessRule;
20: import org.kuali.core.rule.event.KualiDocumentEventBase;
21: import org.kuali.module.kra.budget.bo.BudgetUser;
22: import org.kuali.module.kra.budget.rules.budget.BudgetDocumentRule;
23:
24: /**
25: * Class capturing an insert personnel event.
26: */
27: public class InsertPersonnelEventBase extends KualiDocumentEventBase {
28:
29: private final BudgetUser newBudgetUser;
30: private final boolean isToBeNamed;
31:
32: /**
33: * Constructs a UpdateNonpersonnelEventBase.java.
34: *
35: * @param description
36: * @param errorPathPrefix
37: * @param document
38: */
39: public InsertPersonnelEventBase(String errorPathPrefix,
40: Document document, BudgetUser newBudgetUser,
41: boolean isToBeNamed) {
42: super ("adding periodLine to document "
43: + getDocumentId(document), errorPathPrefix, document);
44:
45: this .isToBeNamed = isToBeNamed;
46: this .newBudgetUser = newBudgetUser;
47: }
48:
49: public InsertPersonnelEventBase(Document document,
50: BudgetUser newBudgetUser, boolean isToBeNamed) {
51: this ("", document, newBudgetUser, isToBeNamed);
52: }
53:
54: /**
55: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
56: */
57: public Class getRuleInterfaceClass() {
58: return BudgetDocumentRule.class;
59: }
60:
61: /**
62: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
63: */
64: public boolean invokeRuleMethod(BusinessRule rule) {
65: return ((BudgetDocumentRule) rule)
66: .processInsertPersonnelBusinessRules(document,
67: newBudgetUser, isToBeNamed);
68: }
69: }
|