1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.rules.rule.event;
17
18 import org.kuali.rice.krad.bo.AdHocRoutePerson;
19 import org.kuali.rice.krad.document.Document;
20 import org.kuali.rice.krad.rules.rule.AddAdHocRoutePersonRule;
21 import org.kuali.rice.krad.rules.rule.BusinessRule;
22
23
24
25
26
27
28
29 public final class AddAdHocRoutePersonEvent extends KualiDocumentEventBase {
30 private AdHocRoutePerson adHocRoutePerson;
31
32
33
34
35
36
37
38
39 public AddAdHocRoutePersonEvent(String errorPathPrefix, Document document, AdHocRoutePerson adHocRoutePerson) {
40 super("creating add ad hoc route person event for document " + KualiDocumentEventBase.getDocumentId(document), errorPathPrefix, document);
41 this.adHocRoutePerson = adHocRoutePerson;
42 }
43
44
45
46
47
48
49
50 public AddAdHocRoutePersonEvent(Document document, AdHocRoutePerson adHocRoutePerson) {
51 this("", document, adHocRoutePerson);
52 }
53
54
55
56
57
58
59 public AdHocRoutePerson getAdHocRoutePerson() {
60 return adHocRoutePerson;
61 }
62
63
64
65
66 @Override
67 public void validate() {
68 super.validate();
69 if (this.adHocRoutePerson == null) {
70 throw new IllegalArgumentException("invalid (null) document adHocRoutePerson");
71 }
72 }
73
74
75
76
77 public Class<? extends BusinessRule> getRuleInterfaceClass() {
78 return AddAdHocRoutePersonRule.class;
79 }
80
81
82
83
84 public boolean invokeRuleMethod(BusinessRule rule) {
85 return ((AddAdHocRoutePersonRule) rule).processAddAdHocRoutePerson(getDocument(), this.adHocRoutePerson);
86 }
87 }