1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.engine.simulation; |
18 | |
|
19 | |
import org.apache.commons.lang.StringUtils; |
20 | |
import org.kuali.rice.kew.actionrequest.Recipient; |
21 | |
import org.kuali.rice.kim.bo.Person; |
22 | |
|
23 | |
import java.util.ArrayList; |
24 | |
import java.util.List; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
public class SimulationCriteria { |
35 | |
|
36 | |
|
37 | |
private String documentId; |
38 | |
private String destinationNodeName; |
39 | 0 | private List<Recipient> destinationRecipients = new ArrayList<Recipient>(); |
40 | |
|
41 | |
|
42 | |
private String documentTypeName; |
43 | |
private String xmlContent; |
44 | 0 | private List<String> nodeNames = new ArrayList<String>(); |
45 | 0 | private List<String> ruleTemplateNames = new ArrayList<String>(); |
46 | |
|
47 | |
|
48 | |
private Boolean activateRequests; |
49 | |
private Person routingUser; |
50 | 0 | private List<SimulationActionToTake> actionsToTake = new ArrayList<SimulationActionToTake>(); |
51 | |
private boolean flattenNodes; |
52 | |
|
53 | 0 | public SimulationCriteria() { |
54 | 0 | this.activateRequests = null; |
55 | 0 | this.flattenNodes = false; |
56 | 0 | } |
57 | |
|
58 | |
public static SimulationCriteria createSimulationCritUsingDocumentId(String documentId) { |
59 | 0 | return new SimulationCriteria(null, documentId); |
60 | |
} |
61 | |
|
62 | |
public static SimulationCriteria createSimulationCritUsingDocTypeName(String documentTypeName) { |
63 | 0 | return new SimulationCriteria(documentTypeName, null); |
64 | |
} |
65 | |
|
66 | 0 | private SimulationCriteria(String documentTypeName, String documentId) { |
67 | 0 | if (StringUtils.isNotBlank(documentId)) { |
68 | 0 | this.documentId = documentId; |
69 | 0 | } else if (StringUtils.isNotBlank(documentTypeName)) { |
70 | 0 | this.documentTypeName = documentTypeName; |
71 | |
} |
72 | 0 | } |
73 | |
|
74 | |
public Boolean isActivateRequests() { |
75 | 0 | return this.activateRequests; |
76 | |
} |
77 | |
|
78 | |
public void setActivateRequests(Boolean activateRequests) { |
79 | 0 | this.activateRequests = activateRequests; |
80 | 0 | } |
81 | |
|
82 | |
public String getDocumentId() { |
83 | 0 | return documentId; |
84 | |
} |
85 | |
|
86 | |
public void setDocumentId(String documentId) { |
87 | 0 | this.documentId = documentId; |
88 | 0 | } |
89 | |
|
90 | |
public String getDestinationNodeName() { |
91 | 0 | return destinationNodeName; |
92 | |
} |
93 | |
|
94 | |
public void setDestinationNodeName(String destinationNodeName) { |
95 | 0 | this.destinationNodeName = destinationNodeName; |
96 | 0 | } |
97 | |
|
98 | |
public List<Recipient> getDestinationRecipients() { |
99 | 0 | return destinationRecipients; |
100 | |
} |
101 | |
|
102 | |
public void setDestinationRecipients(List<Recipient> destinationRecipients) { |
103 | 0 | this.destinationRecipients = destinationRecipients; |
104 | 0 | } |
105 | |
|
106 | |
public String getDocumentTypeName() { |
107 | 0 | return documentTypeName; |
108 | |
} |
109 | |
|
110 | |
public void setDocumentTypeName(String documentTypeName) { |
111 | 0 | this.documentTypeName = documentTypeName; |
112 | 0 | } |
113 | |
|
114 | |
public List<String> getRuleTemplateNames() { |
115 | 0 | return ruleTemplateNames; |
116 | |
} |
117 | |
|
118 | |
public void setRuleTemplateNames(List<String> ruleTemplateNames) { |
119 | 0 | this.ruleTemplateNames = ruleTemplateNames; |
120 | 0 | } |
121 | |
|
122 | |
public String getXmlContent() { |
123 | 0 | return xmlContent; |
124 | |
} |
125 | |
|
126 | |
public void setXmlContent(String xmlContent) { |
127 | 0 | this.xmlContent = xmlContent; |
128 | 0 | } |
129 | |
|
130 | |
public List<String> getNodeNames() { |
131 | 0 | return nodeNames; |
132 | |
} |
133 | |
|
134 | |
public void setNodeNames(List<String> nodeNames) { |
135 | 0 | this.nodeNames = nodeNames; |
136 | 0 | } |
137 | |
|
138 | |
public boolean isDocumentSimulation() { |
139 | 0 | return documentId != null; |
140 | |
} |
141 | |
|
142 | |
public boolean isDocumentTypeSimulation() { |
143 | 0 | return !org.apache.commons.lang.StringUtils.isEmpty(documentTypeName); |
144 | |
} |
145 | |
|
146 | |
public List<SimulationActionToTake> getActionsToTake() { |
147 | 0 | return actionsToTake; |
148 | |
} |
149 | |
|
150 | |
public void setActionsToTake(List<SimulationActionToTake> actionsToTake) { |
151 | 0 | this.actionsToTake = actionsToTake; |
152 | 0 | } |
153 | |
|
154 | |
public Person getRoutingUser() { |
155 | 0 | return routingUser; |
156 | |
} |
157 | |
|
158 | |
public void setRoutingUser(Person routingUser) { |
159 | 0 | this.routingUser = routingUser; |
160 | 0 | } |
161 | |
|
162 | |
public boolean isFlattenNodes() { |
163 | 0 | return this.flattenNodes; |
164 | |
} |
165 | |
|
166 | |
public void setFlattenNodes(boolean flattenNodes) { |
167 | 0 | this.flattenNodes = flattenNodes; |
168 | 0 | } |
169 | |
|
170 | |
} |