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