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.KualiDocumentEvent;
21: import org.kuali.core.rule.event.KualiDocumentEventBase;
22: import org.kuali.module.kra.budget.rules.budget.BudgetDocumentRule;
23:
24: /**
25: * Class capturing an enter modular event.
26: */
27: public class EnterModularEvent extends KualiDocumentEventBase implements
28: KualiDocumentEvent {
29:
30: /**
31: * Constructs an EnterModularEvent with the given errorPathPrefix, document.
32: *
33: * @param errorPathPrefix
34: * @param document
35: * @param accountingLine
36: */
37: public EnterModularEvent(String errorPathPrefix, Document document) {
38: super ("Running enter modular business rules on "
39: + getDocumentId(document), errorPathPrefix, document);
40: }
41:
42: /**
43: * Constructs an EnterModularEvent for the given document
44: *
45: * @param document
46: * @param accountingLine
47: */
48: public EnterModularEvent(Document document) {
49: this ("document.budget.modular", document);
50: }
51:
52: /**
53: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
54: */
55: public Class getRuleInterfaceClass() {
56: return BudgetDocumentRule.class;
57: }
58:
59: /**
60: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
61: */
62: public boolean invokeRuleMethod(BusinessRule rule) {
63: return ((BudgetDocumentRule) rule)
64: .processEnterModularBusinessRules(getDocument());
65: }
66: }
|