1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.workflow.service.impl;
17
18 import java.rmi.RemoteException;
19 import java.util.ArrayList;
20 import java.util.List;
21
22 import org.apache.log4j.Logger;
23 import org.kuali.rice.kew.dto.ActionItemDTO;
24 import org.kuali.rice.kew.dto.ActionRequestDTO;
25 import org.kuali.rice.kew.dto.ActionTakenDTO;
26 import org.kuali.rice.kew.dto.DocumentSearchCriteriaDTO;
27 import org.kuali.rice.kew.dto.DocumentSearchResultDTO;
28 import org.kuali.rice.kew.dto.ReportCriteriaDTO;
29 import org.kuali.rice.kew.exception.WorkflowException;
30 import org.kuali.rice.kew.service.WorkflowInfo;
31 import org.kuali.rice.kew.util.KEWConstants;
32 import org.kuali.rice.krad.workflow.service.KualiWorkflowInfo;
33 import org.springframework.transaction.annotation.Transactional;
34
35
36 @SuppressWarnings("deprecation")
37 @Transactional
38 public class KualiWorkflowInfoImpl implements KualiWorkflowInfo {
39
40 private static final Logger LOG = Logger.getLogger(KualiWorkflowInfoImpl.class);
41
42 private WorkflowInfo workflowInfo;
43
44 public KualiWorkflowInfoImpl() {
45 workflowInfo = new WorkflowInfo();
46 }
47
48 private WorkflowInfo getWorkflowUtility() {
49 return workflowInfo;
50 }
51
52 public String getNewResponsibilityId() throws WorkflowException {
53 return getWorkflowUtility().getNewResponsibilityId();
54 }
55
56 public ActionRequestDTO[] getActionRequests(String documentId) throws WorkflowException {
57 return getWorkflowUtility().getActionRequests(documentId);
58 }
59
60 public ActionRequestDTO[] getActionRequests(String documentId, String nodeName, String principalId) throws WorkflowException {
61 return getWorkflowUtility().getActionRequests(documentId, nodeName, principalId);
62 }
63
64 public ActionTakenDTO[] getActionsTaken(String documentId) throws WorkflowException {
65 return getWorkflowUtility().getActionsTaken(documentId);
66 }
67
68 public void reResolveRoleByDocTypeName(String documentTypeName, String roleName, String qualifiedRoleNameLabel) throws WorkflowException {
69 getWorkflowUtility().reResolveRoleByDocTypeName(documentTypeName, roleName, qualifiedRoleNameLabel);
70 }
71
72 public void reResolveRoleByDocumentId(String documentId, String roleName, String qualifiedRoleNameLabel) throws WorkflowException {
73 getWorkflowUtility().reResolveRoleByDocumentId(documentId, roleName, qualifiedRoleNameLabel);
74 }
75
76
77
78
79
80 public boolean documentWillHaveAtLeastOneActionRequest(ReportCriteriaDTO reportCriteriaDTO, String[] actionRequestedCodes) throws WorkflowException {
81 return documentWillHaveAtLeastOneActionRequest(reportCriteriaDTO, actionRequestedCodes, false);
82 }
83
84
85
86
87 public boolean documentWillHaveAtLeastOneActionRequest(ReportCriteriaDTO reportCriteriaDTO, String[] actionRequestedCodes, boolean ignoreCurrentlyActiveRequests) throws WorkflowException {
88 return getWorkflowUtility().documentWillHaveAtLeastOneActionRequest(reportCriteriaDTO, actionRequestedCodes, ignoreCurrentlyActiveRequests);
89 }
90
91
92
93
94 public List<String> getApprovalRequestedUsers(String documentId) throws WorkflowException {
95 ActionItemDTO[] actionItemVOs = getWorkflowUtility().getActionItems(documentId, new String[]{KEWConstants.ACTION_REQUEST_COMPLETE_REQ, KEWConstants.ACTION_REQUEST_APPROVE_REQ});
96 List<String> users = new ArrayList<String>();
97 for (int i = 0; i < actionItemVOs.length; i++) {
98 ActionItemDTO actionItemVO = actionItemVOs[i];
99 users.add(actionItemVO.getPrincipalId());
100 }
101 return users;
102 }
103
104 public DocumentSearchResultDTO performDocumentSearch(DocumentSearchCriteriaDTO criteriaVO) throws WorkflowException {
105 return getWorkflowUtility().performDocumentSearch(criteriaVO);
106 }
107
108 public DocumentSearchResultDTO performDocumentSearch(String principalId, DocumentSearchCriteriaDTO criteriaVO) throws RemoteException, WorkflowException {
109 return getWorkflowUtility().performDocumentSearch(principalId, criteriaVO);
110 }
111
112 }