| 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 | 0 | private static final Logger LOG = Logger.getLogger(KualiWorkflowInfoImpl.class); |
| 41 | |
|
| 42 | |
private WorkflowInfo workflowInfo; |
| 43 | |
|
| 44 | 0 | public KualiWorkflowInfoImpl() { |
| 45 | 0 | workflowInfo = new WorkflowInfo(); |
| 46 | 0 | } |
| 47 | |
|
| 48 | |
private WorkflowInfo getWorkflowUtility() { |
| 49 | 0 | return workflowInfo; |
| 50 | |
} |
| 51 | |
|
| 52 | |
public String getNewResponsibilityId() throws WorkflowException { |
| 53 | 0 | return getWorkflowUtility().getNewResponsibilityId(); |
| 54 | |
} |
| 55 | |
|
| 56 | |
public ActionRequestDTO[] getActionRequests(String documentId) throws WorkflowException { |
| 57 | 0 | return getWorkflowUtility().getActionRequests(documentId); |
| 58 | |
} |
| 59 | |
|
| 60 | |
public ActionRequestDTO[] getActionRequests(String documentId, String nodeName, String principalId) throws WorkflowException { |
| 61 | 0 | return getWorkflowUtility().getActionRequests(documentId, nodeName, principalId); |
| 62 | |
} |
| 63 | |
|
| 64 | |
public ActionTakenDTO[] getActionsTaken(String documentId) throws WorkflowException { |
| 65 | 0 | return getWorkflowUtility().getActionsTaken(documentId); |
| 66 | |
} |
| 67 | |
|
| 68 | |
public void reResolveRoleByDocTypeName(String documentTypeName, String roleName, String qualifiedRoleNameLabel) throws WorkflowException { |
| 69 | 0 | getWorkflowUtility().reResolveRoleByDocTypeName(documentTypeName, roleName, qualifiedRoleNameLabel); |
| 70 | 0 | } |
| 71 | |
|
| 72 | |
public void reResolveRoleByDocumentId(String documentId, String roleName, String qualifiedRoleNameLabel) throws WorkflowException { |
| 73 | 0 | getWorkflowUtility().reResolveRoleByDocumentId(documentId, roleName, qualifiedRoleNameLabel); |
| 74 | 0 | } |
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
|
| 80 | |
public boolean documentWillHaveAtLeastOneActionRequest(ReportCriteriaDTO reportCriteriaDTO, String[] actionRequestedCodes) throws WorkflowException { |
| 81 | 0 | return documentWillHaveAtLeastOneActionRequest(reportCriteriaDTO, actionRequestedCodes, false); |
| 82 | |
} |
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | |
|
| 87 | |
public boolean documentWillHaveAtLeastOneActionRequest(ReportCriteriaDTO reportCriteriaDTO, String[] actionRequestedCodes, boolean ignoreCurrentlyActiveRequests) throws WorkflowException { |
| 88 | 0 | return getWorkflowUtility().documentWillHaveAtLeastOneActionRequest(reportCriteriaDTO, actionRequestedCodes, ignoreCurrentlyActiveRequests); |
| 89 | |
} |
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
|
| 94 | |
public List<String> getApprovalRequestedUsers(String documentId) throws WorkflowException { |
| 95 | 0 | ActionItemDTO[] actionItemVOs = getWorkflowUtility().getActionItems(documentId, new String[]{KEWConstants.ACTION_REQUEST_COMPLETE_REQ, KEWConstants.ACTION_REQUEST_APPROVE_REQ}); |
| 96 | 0 | List<String> users = new ArrayList<String>(); |
| 97 | 0 | for (int i = 0; i < actionItemVOs.length; i++) { |
| 98 | 0 | ActionItemDTO actionItemVO = actionItemVOs[i]; |
| 99 | 0 | users.add(actionItemVO.getPrincipalId()); |
| 100 | |
} |
| 101 | 0 | return users; |
| 102 | |
} |
| 103 | |
|
| 104 | |
public DocumentSearchResultDTO performDocumentSearch(DocumentSearchCriteriaDTO criteriaVO) throws WorkflowException { |
| 105 | 0 | return getWorkflowUtility().performDocumentSearch(criteriaVO); |
| 106 | |
} |
| 107 | |
|
| 108 | |
public DocumentSearchResultDTO performDocumentSearch(String principalId, DocumentSearchCriteriaDTO criteriaVO) throws RemoteException, WorkflowException { |
| 109 | 0 | return getWorkflowUtility().performDocumentSearch(principalId, criteriaVO); |
| 110 | |
} |
| 111 | |
|
| 112 | |
} |