01: /*
02: * Copyright 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.kfs.rule.event;
17:
18: import org.kuali.core.document.Document;
19: import org.kuali.core.rule.BusinessRule;
20: import org.kuali.kfs.bo.AccountingLine;
21: import org.kuali.kfs.document.AccountingDocument;
22: import org.kuali.kfs.rule.AddAccountingLineRule;
23:
24: /**
25: * This class represents the add accounting line event. This could be triggered when a user presses the add button for a given
26: * document's accounting line.
27: */
28: public final class AddAccountingLineEvent extends
29: AccountingLineEventBase {
30: /**
31: * Constructs an AddAccountingLineEvent with the given errorPathPrefix, document, and accountingLine.
32: *
33: * @param errorPathPrefix
34: * @param document
35: * @param accountingLine
36: */
37: public AddAccountingLineEvent(String errorPathPrefix,
38: Document document, AccountingLine accountingLine) {
39: super ("adding accountingLine to document "
40: + getDocumentId(document), errorPathPrefix, document,
41: accountingLine);
42: }
43:
44: /**
45: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
46: */
47: public Class getRuleInterfaceClass() {
48: return AddAccountingLineRule.class;
49: }
50:
51: /**
52: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
53: */
54: public boolean invokeRuleMethod(BusinessRule rule) {
55: return ((AddAccountingLineRule) rule)
56: .processAddAccountingLineBusinessRules(
57: (AccountingDocument) getDocument(),
58: getAccountingLine());
59: }
60: }
|