001/* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 */ 016package org.kuali.ole.select.document.validation.event; 017 018import org.kuali.ole.select.businessobject.OlePurchaseOrderItem; 019import org.kuali.ole.select.document.validation.impl.OleValidationRule; 020import org.kuali.ole.select.document.validation.impl.OleValidationRuleBase; 021import org.kuali.rice.krad.document.Document; 022import org.kuali.rice.krad.rules.rule.BusinessRule; 023import org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase; 024 025public class ForeignCurrencyPOEvent extends KualiDocumentEventBase { 026 027 private OlePurchaseOrderItem purItem; 028 029 030 protected ForeignCurrencyPOEvent(String errorPathPrefix, Document document) { 031 super("Creating Note Tag" + getDocumentId(document), errorPathPrefix, document); 032 } 033 034 public ForeignCurrencyPOEvent(Document document, OlePurchaseOrderItem purItem) { 035 this("", document); 036 this.purItem = purItem; 037 } 038 039 @Override 040 public Class getRuleInterfaceClass() { 041 return OleValidationRuleBase.class; 042 } 043 044 @Override 045 public boolean invokeRuleMethod(BusinessRule rule) { 046 return ((OleValidationRule) rule).processCustomForeignCurrencyPurchaseOrderBusinessRules(document, purItem); 047 } 048 049 public OlePurchaseOrderItem getPurItem() { 050 return purItem; 051 } 052 053 public void setPurItem(OlePurchaseOrderItem purItem) { 054 this.purItem = purItem; 055 } 056 057 058}