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.module.purap.rule.event;
17:
18: import org.kuali.core.document.Document;
19: import org.kuali.core.rule.BusinessRule;
20: import org.kuali.core.rule.event.SaveOnlyDocumentEvent;
21: import org.kuali.kfs.KFSConstants;
22: import org.kuali.module.purap.document.AccountsPayableDocument;
23: import org.kuali.module.purap.rule.ContinueAccountsPayableRule;
24:
25: /**
26: * Continue Event for Accounts Payable Document.
27: * This could be triggered when a user presses the continue button to go to the next page.
28: */
29: public final class ContinueAccountsPayableEvent extends
30: SaveOnlyDocumentEvent {
31:
32: /**
33: * Overridden constructor.
34: *
35: * @param document the document for this event
36: */
37: public ContinueAccountsPayableEvent(Document document) {
38: this (KFSConstants.EMPTY_STRING, document);
39: }
40:
41: /**
42: * Constructs a ContinueAccountsPayableEvent with the given errorPathPrefix and document.
43: *
44: * @param errorPathPrefix the error path
45: * @param document document the event was invoked upon
46: */
47: public ContinueAccountsPayableEvent(String errorPathPrefix,
48: Document document) {
49: super ("continuing for document " + getDocumentId(document),
50: errorPathPrefix, document);
51: }
52:
53: /**
54: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
55: */
56: public Class getRuleInterfaceClass() {
57: return ContinueAccountsPayableRule.class;
58: }
59:
60: /**
61: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
62: */
63: public boolean invokeRuleMethod(BusinessRule rule) {
64: return ((ContinueAccountsPayableRule) rule)
65: .processContinueAccountsPayableBusinessRules((AccountsPayableDocument) getDocument());
66: }
67: }
|