001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.labor.rule.event;
017:
018: import org.kuali.core.document.TransactionalDocument;
019: import org.kuali.core.rule.BusinessRule;
020: import org.kuali.core.rule.event.KualiDocumentEventBase;
021: import org.kuali.core.util.GeneralLedgerPendingEntrySequenceHelper;
022: import org.kuali.module.labor.document.LaborLedgerPostingDocument;
023: import org.kuali.module.labor.rule.GenerateLaborLedgerBenefitClearingPendingEntriesRule;
024:
025: /**
026: * Event used to re/generate general ledger pending entries for a transactional document.
027: */
028: public final class GenerateLaborLedgerBenefitClearingPendingEntriesEvent
029: extends KualiDocumentEventBase {
030: private GeneralLedgerPendingEntrySequenceHelper sequenceHelper;
031:
032: /**
033: * Constructs a GenerateLaborLedgerBenfitClearingPendingEntriesEvent with the given errorPathPrefix, document, accountingLine,
034: * and counter
035: *
036: * @param errorPathPrefix
037: * @param generalLedgerPostingDocument
038: * @param accountingLine
039: * @param sequenceHelper
040: */
041: public GenerateLaborLedgerBenefitClearingPendingEntriesEvent(
042: String errorPathPrefix,
043: LaborLedgerPostingDocument accountingDocument,
044: GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
045: super (
046: "creating generateLaborLedgerBenefitClearingPendingEntries event for document "
047: + getDocumentId(accountingDocument),
048: errorPathPrefix, accountingDocument);
049: // note that we want to override the parent b/c we do want this by reference here
050: // the parent does a deepCopy and we don't want that b/c we need to set the GLPEs into the document
051: super .document = accountingDocument;
052: this .sequenceHelper = sequenceHelper;
053: }
054:
055: /**
056: * Constructs a GenerateLaaborLedgerBenefitClearingPendingEntriesEvent with the given document and accountingLine
057: *
058: * @param generalLedgerPostingDocument
059: * @param accountingLine
060: * @param sequenceHelper
061: */
062: public GenerateLaborLedgerBenefitClearingPendingEntriesEvent(
063: LaborLedgerPostingDocument accountingDocument,
064: GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
065: this ("", accountingDocument, sequenceHelper);
066: }
067:
068: /**
069: * @return TransactionalDocument associated with this event
070: */
071: public TransactionalDocument getTransactionalDocument() {
072: return (TransactionalDocument) getDocument();
073: }
074:
075: /**
076: * @return sequenceHelper associated with this event
077: */
078: public GeneralLedgerPendingEntrySequenceHelper getSequenceHelper() {
079: return sequenceHelper;
080: }
081:
082: /**
083: * This method sets the value of the sequenceHelper.
084: *
085: * @param sequenceHelper
086: */
087: public void setSequenceHelper(
088: GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
089: this .sequenceHelper = sequenceHelper;
090: }
091:
092: public void validate() {
093: super .validate();
094: }
095:
096: /**
097: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
098: */
099: public Class getRuleInterfaceClass() {
100: return GenerateLaborLedgerBenefitClearingPendingEntriesRule.class;
101: }
102:
103: /**
104: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
105: */
106: public boolean invokeRuleMethod(BusinessRule rule) {
107: return ((GenerateLaborLedgerBenefitClearingPendingEntriesRule) rule)
108: .processGenerateLaborLedgerBenefitClearingPendingEntries(
109: (LaborLedgerPostingDocument) getDocument(),
110: getSequenceHelper());
111: }
112: }
|