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 DiscountPurchaseOrderEvent extends KualiDocumentEventBase { 026 027 private OlePurchaseOrderItem purItem; 028 029 030 protected DiscountPurchaseOrderEvent(String errorPathPrefix, Document document) { 031 super("Creating Note Tag" + getDocumentId(document), errorPathPrefix, document); 032 } 033 034 public DiscountPurchaseOrderEvent(Document document, OlePurchaseOrderItem purItem) { 035 036 this("", document); 037 this.purItem = purItem; 038 } 039 040 @Override 041 public Class getRuleInterfaceClass() { 042 return OleValidationRuleBase.class; 043 } 044 045 @Override 046 public boolean invokeRuleMethod(BusinessRule rule) { 047 return ((OleValidationRule) rule).processCustomAddDiscountPurchaseOrderBusinessRules(document, purItem); 048 } 049 050 public OlePurchaseOrderItem getPurItem() { 051 return purItem; 052 } 053 054 public void setPurItem(OlePurchaseOrderItem purItem) { 055 this.purItem = purItem; 056 } 057 058 059}