| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kns.workflow.service.impl; |
| 17 | |
|
| 18 | |
import java.io.Serializable; |
| 19 | |
import java.sql.Timestamp; |
| 20 | |
import java.util.ArrayList; |
| 21 | |
import java.util.HashSet; |
| 22 | |
import java.util.Iterator; |
| 23 | |
import java.util.Set; |
| 24 | |
|
| 25 | |
import org.apache.commons.lang.StringUtils; |
| 26 | |
import org.kuali.rice.kew.dto.ActionRequestDTO; |
| 27 | |
import org.kuali.rice.kew.dto.ActionTakenDTO; |
| 28 | |
import org.kuali.rice.kew.dto.ReturnPointDTO; |
| 29 | |
import org.kuali.rice.kew.dto.RouteHeaderDTO; |
| 30 | |
import org.kuali.rice.kew.dto.WorkflowAttributeDefinitionDTO; |
| 31 | |
import org.kuali.rice.kew.exception.InvalidActionTakenException; |
| 32 | |
import org.kuali.rice.kew.exception.ResourceUnavailableException; |
| 33 | |
import org.kuali.rice.kew.exception.WorkflowException; |
| 34 | |
import org.kuali.rice.kew.service.WorkflowDocument; |
| 35 | |
import org.kuali.rice.kew.service.WorkflowDocumentActions; |
| 36 | |
import org.kuali.rice.kew.util.KEWConstants; |
| 37 | |
import org.kuali.rice.kim.bo.Person; |
| 38 | |
import org.kuali.rice.kim.service.KIMServiceLocator; |
| 39 | |
import org.kuali.rice.kns.service.KNSServiceLocatorWeb; |
| 40 | |
import org.kuali.rice.kns.workflow.service.KualiWorkflowDocument; |
| 41 | |
import org.kuali.rice.kns.workflow.service.KualiWorkflowInfo; |
| 42 | |
|
| 43 | |
public class KualiWorkflowDocumentImpl implements KualiWorkflowDocument, Serializable { |
| 44 | |
|
| 45 | |
private WorkflowDocument workflowDocument; |
| 46 | |
|
| 47 | 0 | public KualiWorkflowDocumentImpl(String principalId, String documentType) throws WorkflowException { |
| 48 | 0 | workflowDocument = new WorkflowDocument(principalId, documentType); |
| 49 | 0 | } |
| 50 | |
|
| 51 | 0 | public KualiWorkflowDocumentImpl(String principalId, Long routeHeaderId) throws WorkflowException { |
| 52 | 0 | workflowDocument = new WorkflowDocument(principalId, routeHeaderId); |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
|
| 63 | |
|
| 64 | |
|
| 65 | |
public String getApplicationContent() { |
| 66 | 0 | return workflowDocument.getApplicationContent(); |
| 67 | |
} |
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
public void setApplicationContent(String applicationContent) { |
| 73 | 0 | workflowDocument.setApplicationContent(applicationContent); |
| 74 | 0 | } |
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | |
|
| 83 | |
public void clearAttributeContent() { |
| 84 | 0 | workflowDocument.clearAttributeContent(); |
| 85 | 0 | } |
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
public String getAttributeContent() { |
| 91 | 0 | return workflowDocument.getAttributeContent(); |
| 92 | |
} |
| 93 | |
|
| 94 | |
|
| 95 | |
|
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | |
|
| 100 | |
public void addAttributeDefinition(WorkflowAttributeDefinitionDTO attributeDefinition) { |
| 101 | 0 | workflowDocument.addAttributeDefinition(attributeDefinition); |
| 102 | 0 | } |
| 103 | |
|
| 104 | |
public void removeAttributeDefinition(WorkflowAttributeDefinitionDTO attributeDefinition) { |
| 105 | 0 | workflowDocument.removeAttributeDefinition(attributeDefinition); |
| 106 | 0 | } |
| 107 | |
|
| 108 | |
public void clearAttributeDefinitions() { |
| 109 | 0 | workflowDocument.clearAttributeDefinitions(); |
| 110 | 0 | } |
| 111 | |
|
| 112 | |
public WorkflowAttributeDefinitionDTO[] getAttributeDefinitions() { |
| 113 | 0 | return workflowDocument.getAttributeDefinitions(); |
| 114 | |
} |
| 115 | |
|
| 116 | |
|
| 117 | |
|
| 118 | |
|
| 119 | |
|
| 120 | |
|
| 121 | |
|
| 122 | |
public void addSearchableDefinition(WorkflowAttributeDefinitionDTO searchableDefinition) { |
| 123 | 0 | workflowDocument.addSearchableDefinition(searchableDefinition); |
| 124 | 0 | } |
| 125 | |
|
| 126 | |
public void removeSearchableDefinition(WorkflowAttributeDefinitionDTO searchableDefinition) { |
| 127 | 0 | workflowDocument.removeSearchableDefinition(searchableDefinition); |
| 128 | 0 | } |
| 129 | |
|
| 130 | |
public void clearSearchableDefinitions() { |
| 131 | 0 | workflowDocument.clearSearchableDefinitions(); |
| 132 | 0 | } |
| 133 | |
|
| 134 | |
public WorkflowAttributeDefinitionDTO[] getSearchableDefinitions() { |
| 135 | 0 | return workflowDocument.getSearchableDefinitions(); |
| 136 | |
} |
| 137 | |
|
| 138 | |
|
| 139 | |
|
| 140 | |
|
| 141 | |
|
| 142 | |
public RouteHeaderDTO getRouteHeader() { |
| 143 | 0 | return workflowDocument.getRouteHeader(); |
| 144 | |
} |
| 145 | |
|
| 146 | |
public Long getRouteHeaderId() throws WorkflowException { |
| 147 | 0 | return workflowDocument.getRouteHeaderId(); |
| 148 | |
} |
| 149 | |
|
| 150 | |
public void setAppDocId(String appDocId) { |
| 151 | 0 | workflowDocument.setAppDocId(appDocId); |
| 152 | 0 | } |
| 153 | |
|
| 154 | |
public String getAppDocId() { |
| 155 | 0 | return workflowDocument.getAppDocId(); |
| 156 | |
} |
| 157 | |
|
| 158 | |
public String getTitle() { |
| 159 | 0 | return workflowDocument.getTitle(); |
| 160 | |
} |
| 161 | |
|
| 162 | |
public String getInitiatorPrincipalId() { |
| 163 | 0 | return workflowDocument.getRouteHeader().getInitiatorPrincipalId(); |
| 164 | |
} |
| 165 | |
|
| 166 | |
public String getRoutedByPrincipalId() { |
| 167 | 0 | return workflowDocument.getRouteHeader().getRoutedByPrincipalId(); |
| 168 | |
} |
| 169 | |
|
| 170 | |
public void saveDocument(String annotation) throws WorkflowException { |
| 171 | 0 | workflowDocument.saveDocument(annotation); |
| 172 | 0 | } |
| 173 | |
|
| 174 | |
public void routeDocument(String annotation) throws WorkflowException { |
| 175 | 0 | workflowDocument.routeDocument(annotation); |
| 176 | 0 | } |
| 177 | |
|
| 178 | |
public void disapprove(String annotation) throws WorkflowException { |
| 179 | 0 | workflowDocument.disapprove(annotation); |
| 180 | 0 | } |
| 181 | |
|
| 182 | |
public void approve(String annotation) throws WorkflowException { |
| 183 | 0 | workflowDocument.approve(annotation); |
| 184 | 0 | } |
| 185 | |
|
| 186 | |
public void superUserApprove(String annotation) throws WorkflowException { |
| 187 | 0 | workflowDocument.superUserApprove(annotation); |
| 188 | 0 | } |
| 189 | |
|
| 190 | |
public void superUserActionRequestApprove(Long actionRequestId, String annotation) throws WorkflowException { |
| 191 | 0 | workflowDocument.superUserActionRequestApprove(actionRequestId, annotation); |
| 192 | 0 | } |
| 193 | |
|
| 194 | |
public void superUserCancel(String annotation) throws WorkflowException { |
| 195 | 0 | workflowDocument.superUserCancel(annotation); |
| 196 | 0 | } |
| 197 | |
|
| 198 | |
public void superUserDisapprove(String annotation) throws WorkflowException { |
| 199 | 0 | workflowDocument.superUserDisapprove(annotation); |
| 200 | 0 | } |
| 201 | |
|
| 202 | |
public void cancel(String annotation) throws WorkflowException { |
| 203 | 0 | workflowDocument.cancel(annotation); |
| 204 | 0 | } |
| 205 | |
|
| 206 | |
public void blanketApprove(String annotation) throws WorkflowException { |
| 207 | 0 | workflowDocument.blanketApprove(annotation); |
| 208 | 0 | } |
| 209 | |
|
| 210 | |
public void saveRoutingData() throws WorkflowException { |
| 211 | 0 | workflowDocument.saveRoutingData(); |
| 212 | 0 | } |
| 213 | |
|
| 214 | |
public void acknowledge(String annotation) throws WorkflowException { |
| 215 | 0 | workflowDocument.acknowledge(annotation); |
| 216 | 0 | } |
| 217 | |
|
| 218 | |
public void fyi() throws WorkflowException { |
| 219 | 0 | workflowDocument.fyi(); |
| 220 | 0 | } |
| 221 | |
|
| 222 | |
public void delete() throws WorkflowException { |
| 223 | 0 | workflowDocument.delete(); |
| 224 | 0 | } |
| 225 | |
|
| 226 | |
public void refreshContent() throws WorkflowException { |
| 227 | 0 | workflowDocument.refreshContent(); |
| 228 | 0 | } |
| 229 | |
|
| 230 | |
public void adHocRouteDocumentToPrincipal(String actionRequested, String routeTypeName, String annotation, String principalId, String responsibilityDesc, boolean forceAction) throws WorkflowException { |
| 231 | 0 | workflowDocument.adHocRouteDocumentToPrincipal(actionRequested, routeTypeName, annotation, principalId, responsibilityDesc, forceAction); |
| 232 | 0 | } |
| 233 | |
|
| 234 | |
public void adHocRouteDocumentToGroup(String actionRequested, String routeTypeName, String annotation, String groupId, String responsibilityDesc, boolean forceAction) throws WorkflowException { |
| 235 | 0 | workflowDocument.adHocRouteDocumentToGroup(actionRequested, routeTypeName, annotation, groupId, responsibilityDesc, forceAction); |
| 236 | 0 | } |
| 237 | |
|
| 238 | |
public void adHocRouteDocumentToPrincipal(String actionRequested, String routeTypeName, String annotation, String principalId, String responsibilityDesc, boolean forceAction, String actionRequestLabel) throws WorkflowException { |
| 239 | 0 | workflowDocument.adHocRouteDocumentToPrincipal(actionRequested, routeTypeName, annotation, principalId, responsibilityDesc, forceAction, actionRequestLabel); |
| 240 | 0 | } |
| 241 | |
|
| 242 | |
public void adHocRouteDocumentToGroup(String actionRequested, String routeTypeName, String annotation, String groupId, String responsibilityDesc, boolean forceAction, String actionRequestLabel) throws WorkflowException { |
| 243 | 0 | workflowDocument.adHocRouteDocumentToGroup(actionRequested, routeTypeName, annotation, groupId, responsibilityDesc, forceAction, actionRequestLabel); |
| 244 | 0 | } |
| 245 | |
|
| 246 | |
public void setTitle(String title) throws WorkflowException { |
| 247 | 0 | workflowDocument.setTitle(title); |
| 248 | 0 | } |
| 249 | |
|
| 250 | |
public String getDocumentType() { |
| 251 | 0 | return workflowDocument.getDocumentType(); |
| 252 | |
} |
| 253 | |
|
| 254 | |
|
| 255 | |
|
| 256 | |
|
| 257 | |
public boolean isAdHocRequested() { |
| 258 | 0 | boolean isAdHocRequested = false; |
| 259 | 0 | Long routeHeaderId = null; |
| 260 | 0 | KualiWorkflowInfo workflowInfo = null; |
| 261 | |
try { |
| 262 | 0 | routeHeaderId = getRouteHeaderId(); |
| 263 | 0 | workflowInfo = KNSServiceLocatorWeb.getWorkflowInfoService(); |
| 264 | 0 | String principalId = workflowDocument.getPrincipalId(); |
| 265 | 0 | ActionRequestDTO[] actionRequests = workflowInfo.getActionRequests(routeHeaderId); |
| 266 | 0 | for (int actionRequestIndex = 0; actionRequestIndex < actionRequests.length; actionRequestIndex++) { |
| 267 | 0 | if (actionRequests[actionRequestIndex].isActivated() && actionRequests[actionRequestIndex].isAdHocRequest()) { |
| 268 | 0 | if (actionRequests[actionRequestIndex].isUserRequest() && principalId.equals(actionRequests[actionRequestIndex].getPrincipalId())) { |
| 269 | 0 | isAdHocRequested = true; |
| 270 | |
} |
| 271 | 0 | else if (actionRequests[actionRequestIndex].isGroupRequest()) { |
| 272 | 0 | if (KIMServiceLocator.getIdentityManagementService().isMemberOfGroup(principalId, actionRequests[actionRequestIndex].getGroupId())) { |
| 273 | 0 | isAdHocRequested = true; |
| 274 | |
} |
| 275 | |
} |
| 276 | |
} |
| 277 | |
} |
| 278 | |
} |
| 279 | 0 | catch (WorkflowException e) { |
| 280 | 0 | throw new RuntimeException(new StringBuffer(getClass().getName()).append(" encountered an exception while attempting to get the actoins requests for routeHeaderId: ").append(routeHeaderId).toString(), e); |
| 281 | 0 | } |
| 282 | 0 | return isAdHocRequested; |
| 283 | |
} |
| 284 | |
|
| 285 | |
|
| 286 | |
|
| 287 | |
|
| 288 | |
|
| 289 | |
public boolean isAcknowledgeRequested() { |
| 290 | 0 | return workflowDocument.isAcknowledgeRequested(); |
| 291 | |
} |
| 292 | |
|
| 293 | |
|
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
public boolean isApprovalRequested() { |
| 298 | 0 | return workflowDocument.isApprovalRequested(); |
| 299 | |
} |
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
public boolean isCompletionRequested() { |
| 306 | 0 | return workflowDocument.isCompletionRequested(); |
| 307 | |
} |
| 308 | |
|
| 309 | |
|
| 310 | |
|
| 311 | |
|
| 312 | |
|
| 313 | |
public boolean isFYIRequested() { |
| 314 | 0 | return workflowDocument.isFYIRequested(); |
| 315 | |
} |
| 316 | |
|
| 317 | |
|
| 318 | |
|
| 319 | |
|
| 320 | |
|
| 321 | |
public boolean isBlanketApproveCapable() { |
| 322 | 0 | return workflowDocument.isBlanketApproveCapable(); |
| 323 | |
} |
| 324 | |
|
| 325 | |
@SuppressWarnings("deprecation") |
| 326 | |
public Integer getDocRouteLevel() { |
| 327 | 0 | return workflowDocument.getDocRouteLevel(); |
| 328 | |
} |
| 329 | |
|
| 330 | |
|
| 331 | |
|
| 332 | |
|
| 333 | |
|
| 334 | |
|
| 335 | |
|
| 336 | |
public void complete(String annotation) throws WorkflowException { |
| 337 | 0 | workflowDocument.complete(annotation); |
| 338 | 0 | } |
| 339 | |
|
| 340 | |
|
| 341 | |
|
| 342 | |
|
| 343 | |
|
| 344 | |
|
| 345 | |
|
| 346 | |
|
| 347 | |
|
| 348 | |
public void returnToPreviousNode(String annotation, String nodeName) throws WorkflowException { |
| 349 | 0 | workflowDocument.returnToPreviousNode(annotation, nodeName); |
| 350 | 0 | } |
| 351 | |
|
| 352 | |
|
| 353 | |
|
| 354 | |
|
| 355 | |
|
| 356 | |
|
| 357 | |
|
| 358 | |
|
| 359 | |
|
| 360 | |
public void returnToPreviousNode(String annotation, ReturnPointDTO returnPoint) throws WorkflowException { |
| 361 | 0 | workflowDocument.returnToPreviousNode(annotation, returnPoint); |
| 362 | 0 | } |
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
|
| 369 | |
|
| 370 | |
|
| 371 | |
|
| 372 | |
@SuppressWarnings("deprecation") |
| 373 | |
public void returnToPreviousRouteLevel(String annotation, Integer destRouteLevel) throws WorkflowException { |
| 374 | 0 | workflowDocument.returnToPreviousRouteLevel(annotation, destRouteLevel); |
| 375 | 0 | } |
| 376 | |
|
| 377 | |
public void logDocumentAction(String annotation) throws WorkflowException { |
| 378 | 0 | workflowDocument.logDocumentAction(annotation); |
| 379 | 0 | } |
| 380 | |
|
| 381 | |
|
| 382 | |
|
| 383 | |
|
| 384 | |
|
| 385 | |
|
| 386 | |
public boolean stateIsInitiated() { |
| 387 | 0 | return workflowDocument.stateIsInitiated(); |
| 388 | |
} |
| 389 | |
|
| 390 | |
|
| 391 | |
|
| 392 | |
|
| 393 | |
|
| 394 | |
|
| 395 | |
public boolean stateIsSaved() { |
| 396 | 0 | return workflowDocument.stateIsSaved(); |
| 397 | |
} |
| 398 | |
|
| 399 | |
|
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
public boolean stateIsEnroute() { |
| 405 | 0 | return workflowDocument.stateIsEnroute(); |
| 406 | |
} |
| 407 | |
|
| 408 | |
|
| 409 | |
|
| 410 | |
|
| 411 | |
|
| 412 | |
|
| 413 | |
public boolean stateIsFinal() { |
| 414 | 0 | return workflowDocument.stateIsFinal(); |
| 415 | |
} |
| 416 | |
|
| 417 | |
|
| 418 | |
|
| 419 | |
|
| 420 | |
|
| 421 | |
|
| 422 | |
public boolean stateIsException() { |
| 423 | 0 | return workflowDocument.stateIsException(); |
| 424 | |
} |
| 425 | |
|
| 426 | |
|
| 427 | |
|
| 428 | |
|
| 429 | |
|
| 430 | |
|
| 431 | |
public boolean stateIsCanceled() { |
| 432 | 0 | return workflowDocument.stateIsCanceled(); |
| 433 | |
} |
| 434 | |
|
| 435 | |
|
| 436 | |
|
| 437 | |
|
| 438 | |
|
| 439 | |
|
| 440 | |
public boolean stateIsDisapproved() { |
| 441 | 0 | return workflowDocument.stateIsDisapproved(); |
| 442 | |
} |
| 443 | |
|
| 444 | |
|
| 445 | |
|
| 446 | |
|
| 447 | |
|
| 448 | |
|
| 449 | |
public boolean stateIsApproved() { |
| 450 | 0 | return workflowDocument.stateIsApproved(); |
| 451 | |
} |
| 452 | |
|
| 453 | |
|
| 454 | |
|
| 455 | |
|
| 456 | |
|
| 457 | |
|
| 458 | |
public boolean stateIsProcessed() { |
| 459 | 0 | return workflowDocument.stateIsProcessed(); |
| 460 | |
} |
| 461 | |
|
| 462 | |
public String getStatusDisplayValue() { |
| 463 | 0 | return workflowDocument.getStatusDisplayValue(); |
| 464 | |
} |
| 465 | |
|
| 466 | |
public Timestamp getCreateDate() { |
| 467 | 0 | return workflowDocument.getDateCreated(); |
| 468 | |
} |
| 469 | |
|
| 470 | |
|
| 471 | |
|
| 472 | |
|
| 473 | |
|
| 474 | |
|
| 475 | |
public boolean userIsInitiator(Person user) { |
| 476 | 0 | if (user == null) { |
| 477 | 0 | throw new IllegalArgumentException("invalid (null) user"); |
| 478 | |
} |
| 479 | |
|
| 480 | 0 | return StringUtils.equalsIgnoreCase(getInitiatorPrincipalId(), user.getPrincipalId()); |
| 481 | |
} |
| 482 | |
|
| 483 | |
|
| 484 | |
|
| 485 | |
|
| 486 | |
|
| 487 | |
public boolean userIsRoutedByUser(Person user) { |
| 488 | 0 | if (user == null) { |
| 489 | 0 | throw new IllegalArgumentException("invalid (null) user"); |
| 490 | |
} |
| 491 | |
|
| 492 | 0 | return StringUtils.equalsIgnoreCase(getRoutedByPrincipalId(), user.getPrincipalId()); |
| 493 | |
} |
| 494 | |
|
| 495 | |
public String[] getNodeNames() throws WorkflowException { |
| 496 | 0 | return workflowDocument.getNodeNames(); |
| 497 | |
} |
| 498 | |
|
| 499 | |
public String getCurrentRouteNodeNames() { |
| 500 | 0 | return workflowDocument.getRouteHeader().getCurrentRouteNodeNames(); |
| 501 | |
} |
| 502 | |
|
| 503 | |
public boolean isStandardSaveAllowed() { |
| 504 | 0 | return workflowDocument.isActionCodeValidForDocument(KEWConstants.ACTION_TAKEN_SAVED_CD); |
| 505 | |
} |
| 506 | |
|
| 507 | |
public void setReceiveFutureRequests() throws WorkflowException { |
| 508 | 0 | workflowDocument.setReceiveFutureRequests(); |
| 509 | 0 | } |
| 510 | |
|
| 511 | |
public void setDoNotReceiveFutureRequests() throws WorkflowException { |
| 512 | 0 | workflowDocument.setDoNotReceiveFutureRequests(); |
| 513 | 0 | } |
| 514 | |
|
| 515 | |
public void setClearFutureRequests() throws WorkflowException { |
| 516 | 0 | workflowDocument.setClearFutureRequests(); |
| 517 | 0 | } |
| 518 | |
|
| 519 | |
|
| 520 | |
|
| 521 | |
|
| 522 | |
public String toString() { |
| 523 | 0 | ArrayList trueFlags = new ArrayList(); |
| 524 | 0 | if (isAcknowledgeRequested()) { |
| 525 | 0 | trueFlags.add("acknowledgeRequested"); |
| 526 | |
} |
| 527 | 0 | if (isApprovalRequested()) { |
| 528 | 0 | trueFlags.add("approvalRequested"); |
| 529 | |
} |
| 530 | 0 | if (isBlanketApproveCapable()) { |
| 531 | 0 | trueFlags.add("blanketApproveCapable"); |
| 532 | |
} |
| 533 | 0 | if (isCompletionRequested()) { |
| 534 | 0 | trueFlags.add("completionRequested"); |
| 535 | |
} |
| 536 | 0 | if (isFYIRequested()) { |
| 537 | 0 | trueFlags.add("FYIRequested"); |
| 538 | |
} |
| 539 | |
|
| 540 | 0 | if (stateIsApproved()) { |
| 541 | 0 | trueFlags.add("stateIsApproved"); |
| 542 | |
} |
| 543 | 0 | if (stateIsCanceled()) { |
| 544 | 0 | trueFlags.add("stateIsCanceled"); |
| 545 | |
} |
| 546 | 0 | if (stateIsDisapproved()) { |
| 547 | 0 | trueFlags.add("stateIsDisapproved"); |
| 548 | |
} |
| 549 | 0 | if (stateIsEnroute()) { |
| 550 | 0 | trueFlags.add("stateIsEnroute"); |
| 551 | |
} |
| 552 | 0 | if (stateIsException()) { |
| 553 | 0 | trueFlags.add("stateIsException"); |
| 554 | |
} |
| 555 | 0 | if (stateIsFinal()) { |
| 556 | 0 | trueFlags.add("stateIsFinal"); |
| 557 | |
} |
| 558 | 0 | if (stateIsInitiated()) { |
| 559 | 0 | trueFlags.add("stateIsInitiated"); |
| 560 | |
} |
| 561 | 0 | if (stateIsProcessed()) { |
| 562 | 0 | trueFlags.add("stateIsProcessed"); |
| 563 | |
} |
| 564 | 0 | if (stateIsSaved()) { |
| 565 | 0 | trueFlags.add("stateIsSaved"); |
| 566 | |
} |
| 567 | |
|
| 568 | 0 | StringBuffer b = new StringBuffer("true flags=("); |
| 569 | 0 | for (Iterator i = trueFlags.iterator(); i.hasNext();) { |
| 570 | 0 | b.append(i.next()); |
| 571 | 0 | if (i.hasNext()) { |
| 572 | 0 | b.append(","); |
| 573 | |
} |
| 574 | |
} |
| 575 | 0 | b.append(")"); |
| 576 | |
|
| 577 | 0 | return b.toString(); |
| 578 | |
} |
| 579 | |
|
| 580 | |
|
| 581 | |
|
| 582 | |
|
| 583 | |
public Set<Person> getAllPriorApprovers() throws WorkflowException { |
| 584 | 0 | org.kuali.rice.kim.service.PersonService personService = KIMServiceLocator.getPersonService(); |
| 585 | 0 | ActionTakenDTO[] actionsTaken = workflowDocument.getActionsTaken(); |
| 586 | 0 | Set<String> principalIds = new HashSet<String>(); |
| 587 | 0 | Set<Person> persons = new HashSet<Person>(); |
| 588 | |
|
| 589 | 0 | for (ActionTakenDTO actionTaken : actionsTaken) { |
| 590 | 0 | if (KEWConstants.ACTION_TAKEN_APPROVED_CD.equals(actionTaken.getActionTaken())) { |
| 591 | 0 | String principalId = actionTaken.getPrincipalId(); |
| 592 | 0 | if (!principalIds.contains(principalId)) { |
| 593 | 0 | principalIds.add(principalId); |
| 594 | 0 | persons.add(personService.getPerson(principalId)); |
| 595 | |
} |
| 596 | |
} |
| 597 | |
} |
| 598 | 0 | return persons; |
| 599 | |
} |
| 600 | |
} |