1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.validation.event;
17
18 import org.kuali.ole.module.purap.businessobject.LineItemReceivingItem;
19 import org.kuali.ole.module.purap.businessobject.ReceivingItem;
20 import org.kuali.ole.module.purap.document.ReceivingDocument;
21 import org.kuali.ole.module.purap.document.validation.AddReceivingItemRule;
22 import org.kuali.ole.sys.OLEConstants;
23 import org.kuali.rice.krad.document.Document;
24 import org.kuali.rice.krad.rules.rule.BusinessRule;
25 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent;
26 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase;
27
28 public class AddReceivingItemEvent extends KualiDocumentEventBase implements KualiDocumentEvent {
29
30 private LineItemReceivingItem item;
31
32 public AddReceivingItemEvent(String errorPathPrefix, Document document, LineItemReceivingItem item) {
33
34 super("adding item to document " + getDocumentId(document), errorPathPrefix, document);
35 this.item = item;
36 }
37
38 public Class getRuleInterfaceClass() {
39 return AddReceivingItemRule.class;
40 }
41
42 public boolean invokeRuleMethod(BusinessRule rule) {
43 return ((AddReceivingItemRule) rule).processAddReceivingItemRules((ReceivingDocument) document, item, OLEConstants.EMPTY_STRING);
44 }
45
46 public ReceivingItem getItem() {
47 return item;
48 }
49
50 public void setItem(LineItemReceivingItem item) {
51 this.item = item;
52 }
53
54 }