Coverage Report - org.kuali.rice.kew.service.WorkflowUtility
 
Classes in this File Line Coverage Branch Coverage Complexity
WorkflowUtility
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  *
 4  
  *
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.service;
 18  
 
 19  
 import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
 20  
 import org.kuali.rice.core.api.util.jaxb.SqlTimestampAdapter;
 21  
 import org.kuali.rice.kew.dto.ActionItemDTO;
 22  
 import org.kuali.rice.kew.dto.ActionRequestDTO;
 23  
 import org.kuali.rice.kew.dto.ActionTakenDTO;
 24  
 import org.kuali.rice.kew.dto.DocumentContentDTO;
 25  
 import org.kuali.rice.kew.dto.DocumentDetailDTO;
 26  
 import org.kuali.rice.kew.dto.DocumentLinkDTO;
 27  
 import org.kuali.rice.kew.dto.DocumentSearchCriteriaDTO;
 28  
 import org.kuali.rice.kew.dto.DocumentSearchResultDTO;
 29  
 import org.kuali.rice.kew.dto.DocumentStatusTransitionDTO;
 30  
 import org.kuali.rice.kew.dto.ReportCriteriaDTO;
 31  
 import org.kuali.rice.kew.dto.RouteNodeInstanceDTO;
 32  
 import org.kuali.rice.kew.dto.RuleDTO;
 33  
 import org.kuali.rice.kew.dto.RuleReportCriteriaDTO;
 34  
 import org.kuali.rice.kew.dto.WorkflowAttributeDefinitionDTO;
 35  
 import org.kuali.rice.kew.dto.WorkflowAttributeValidationErrorDTO;
 36  
 import org.kuali.rice.kew.exception.WorkflowException;
 37  
 import org.kuali.rice.kew.util.KEWWebServiceConstants;
 38  
 
 39  
 import javax.jws.WebParam;
 40  
 import javax.jws.WebService;
 41  
 import javax.jws.soap.SOAPBinding;
 42  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 43  
 import java.math.BigDecimal;
 44  
 import java.sql.Timestamp;
 45  
 import java.util.List;
 46  
 import java.util.Map;
 47  
 
 48  
 /**
 49  
  * A remotable service which provides an API for performing various queries and
 50  
  * other utilities on KEW.
 51  
  * 
 52  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 53  
  */
 54  
 @WebService(name = KEWWebServiceConstants.WorkflowUtility.WEB_SERVICE_NAME, targetNamespace = KEWWebServiceConstants.MODULE_TARGET_NAMESPACE)
 55  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 56  
 public interface WorkflowUtility {
 57  
 
 58  
         public DocumentDetailDTO getDocumentDetail(
 59  
                         @WebParam(name = "documentId") String documentId)
 60  
                         throws WorkflowException;
 61  
 
 62  
         public RouteNodeInstanceDTO getNodeInstance(
 63  
                         @WebParam(name = "nodeInstanceId") String nodeInstanceId)
 64  
                         throws WorkflowException;
 65  
 
 66  
         public String getNewResponsibilityId() throws WorkflowException;
 67  
 
 68  
         public Integer getUserActionItemCount(
 69  
                         @WebParam(name = "principalId") String principalId)
 70  
                         throws WorkflowException;
 71  
 
 72  
         public ActionItemDTO[] getAllActionItems(
 73  
                         @WebParam(name = "documentId") String documentId)
 74  
                         throws WorkflowException;
 75  
 
 76  
         public ActionItemDTO[] getActionItems(
 77  
                         @WebParam(name = "documentId") String documentId,
 78  
                         @WebParam(name = "actionRequestedCodes") String[] actionRequestedCodes)
 79  
                         throws WorkflowException;
 80  
 
 81  
         public ActionRequestDTO[] getAllActionRequests(
 82  
                         @WebParam(name = "documentId") String documentId)
 83  
                         throws WorkflowException;
 84  
 
 85  
         public ActionRequestDTO[] getActionRequests(
 86  
                         @WebParam(name = "documentId") String documentId,
 87  
                         @WebParam(name = "nodeName") String nodeName,
 88  
                         @WebParam(name = "principalId") String principalId)
 89  
                         throws WorkflowException;
 90  
 
 91  
         public ActionTakenDTO[] getActionsTaken(
 92  
                         @WebParam(name = "documentId") String documentId)
 93  
                         throws WorkflowException;
 94  
 
 95  
         public WorkflowAttributeValidationErrorDTO[] validateWorkflowAttributeDefinitionVO(
 96  
                         @WebParam(name = "definition") WorkflowAttributeDefinitionDTO definition)
 97  
                         throws WorkflowException;
 98  
 
 99  
         public boolean isUserInRouteLog(
 100  
                         @WebParam(name = "documentId") String documentId,
 101  
                         @WebParam(name = "principalId") String principalId,
 102  
                         @WebParam(name = "lookFuture") boolean lookFuture)
 103  
                         throws WorkflowException;
 104  
 
 105  
         public boolean isUserInRouteLogWithOptionalFlattening(
 106  
                         @WebParam(name = "documentId") String documentId,
 107  
                         @WebParam(name = "principalId") String principalId,
 108  
                         @WebParam(name = "lookFuture") boolean lookFuture,
 109  
                         @WebParam(name = "flattenNodes") boolean flattenNodes)
 110  
                         throws WorkflowException;
 111  
 
 112  
         public void reResolveRoleByDocTypeName(
 113  
                         @WebParam(name = "documentTypeName") String documentTypeName,
 114  
                         @WebParam(name = "roleName") String roleName,
 115  
                         @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel)
 116  
                         throws WorkflowException;
 117  
 
 118  
         public void reResolveRoleByDocumentId(
 119  
                         @WebParam(name = "documentId") String documentId,
 120  
                         @WebParam(name = "roleName") String roleName,
 121  
                         @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel)
 122  
                         throws WorkflowException;
 123  
 
 124  
         public DocumentDetailDTO routingReport(
 125  
                         @WebParam(name = "reportCriteria") ReportCriteriaDTO reportCriteria)
 126  
                         throws WorkflowException;
 127  
 
 128  
         public boolean isFinalApprover(
 129  
                         @WebParam(name = "documentId") String documentId,
 130  
                         @WebParam(name = "principalId") String principalId)
 131  
                         throws WorkflowException;
 132  
 
 133  
         public boolean isSuperUserForDocumentType(
 134  
                         @WebParam(name = "principalId") String principalId,
 135  
                         @WebParam(name = "documentTypeId") String documentTypeId)
 136  
                         throws WorkflowException;
 137  
 
 138  
         public String getAppDocId(
 139  
                         @WebParam(name = "documentId") String documentId);
 140  
         
 141  
         public DocumentSearchResultDTO performDocumentSearch(
 142  
                         @WebParam(name = "criteriaVO") DocumentSearchCriteriaDTO criteriaVO)
 143  
                         throws WorkflowException;
 144  
 
 145  
         public DocumentSearchResultDTO performDocumentSearchWithPrincipal(
 146  
                         @WebParam(name = "principalId") String principalId,
 147  
                         @WebParam(name = "criteriaVO") DocumentSearchCriteriaDTO criteriaVO)
 148  
                         throws WorkflowException;
 149  
 
 150  
         // new in 2.3
 151  
 
 152  
         public RuleDTO[] ruleReport(
 153  
                         @WebParam(name = "ruleReportCriteria") RuleReportCriteriaDTO ruleReportCriteria)
 154  
                         throws WorkflowException;
 155  
 
 156  
         // deprecated as of 2.1
 157  
 
 158  
         /**
 159  
          * @deprecated use isLastApproverAtNode instead
 160  
          */
 161  
         public boolean isLastApproverInRouteLevel(
 162  
                         @WebParam(name = "documentId") String documentId,
 163  
                         @WebParam(name = "principalId") String principalId,
 164  
                         @WebParam(name = "routeLevel") Integer routeLevel)
 165  
                         throws WorkflowException;
 166  
 
 167  
         /**
 168  
          * @deprecated use routeNodeHasApproverActionRequest instead
 169  
          */
 170  
         public boolean routeLevelHasApproverActionRequest(
 171  
                         @WebParam(name = "docType") String docType,
 172  
                         @WebParam(name = "docContent") String docContent,
 173  
                         @WebParam(name = "routeLevel") Integer routeLevel)
 174  
                         throws WorkflowException;
 175  
 
 176  
         // new in 2.1
 177  
 
 178  
         public boolean isLastApproverAtNode(
 179  
                         @WebParam(name = "documentId") String documentId,
 180  
                         @WebParam(name = "principalId") String principalId,
 181  
                         @WebParam(name = "nodeName") String nodeName)
 182  
                         throws WorkflowException;
 183  
 
 184  
         public boolean routeNodeHasApproverActionRequest(
 185  
                         @WebParam(name = "docType") String docType,
 186  
                         @WebParam(name = "docContent") String docContent,
 187  
                         @WebParam(name = "nodeName") String nodeName)
 188  
                         throws WorkflowException;
 189  
 
 190  
         public RouteNodeInstanceDTO[] getDocumentRouteNodeInstances(
 191  
                         @WebParam(name = "documentId") String documentId)
 192  
                         throws WorkflowException;
 193  
 
 194  
         public RouteNodeInstanceDTO[] getActiveNodeInstances(
 195  
                         @WebParam(name = "documentId") String documentId)
 196  
                         throws WorkflowException;
 197  
 
 198  
         public RouteNodeInstanceDTO[] getTerminalNodeInstances(
 199  
                         @WebParam(name = "documentId") String documentId)
 200  
                         throws WorkflowException;
 201  
 
 202  
         public DocumentContentDTO getDocumentContent(
 203  
                         @WebParam(name = "documentId") String documentId)
 204  
                         throws WorkflowException;
 205  
 
 206  
         // 2.2
 207  
         public String[] getPreviousRouteNodeNames(
 208  
                         @WebParam(name = "documentId") String documentId)
 209  
                         throws WorkflowException;
 210  
 
 211  
         // 2.4
 212  
         public boolean documentWillHaveAtLeastOneActionRequest(
 213  
                         @WebParam(name = "reportCriteriaDTO") ReportCriteriaDTO reportCriteriaDTO,
 214  
                         @WebParam(name = "actionRequestedCodes") String[] actionRequestedCodes,
 215  
                         @WebParam(name = "ignoreCurrentActionRequests") boolean ignoreCurrentActionRequests);
 216  
 
 217  
         /**
 218  
          * @since 0.9.1
 219  
          */
 220  
         public String getDocumentStatus(
 221  
                         @WebParam(name = "documentId") String documentId)
 222  
                         throws WorkflowException;
 223  
 
 224  
         public RouteNodeInstanceDTO[] getCurrentNodeInstances(
 225  
                         @WebParam(name = "documentId") String documentId)
 226  
                         throws WorkflowException;
 227  
 
 228  
         // added for KS per Scott
 229  
         ActionItemDTO[] getActionItemsForPrincipal(
 230  
                         @WebParam(name = "principalId") String principalId)
 231  
                         throws WorkflowException;
 232  
 
 233  
         /**
 234  
          * 
 235  
          * This method gets a list of ids of all principals who have a pending
 236  
          * action request for a document.
 237  
          * 
 238  
          * @param actionRequestedCd
 239  
          * @param documentId
 240  
          * @return
 241  
          * @throws WorkflowException
 242  
          */
 243  
         public String[] getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(
 244  
                         @WebParam(name = "actionRequestedCd") String actionRequestedCd,
 245  
                         @WebParam(name = "documentId") String documentId)
 246  
                         throws WorkflowException;
 247  
 
 248  
         /**
 249  
          * This method gets a list of ids of all principals in the route log - -
 250  
          * initiators, - people who have taken action, - people with a pending
 251  
          * action request, - people who will receive an action request for the
 252  
          * document in question
 253  
          * 
 254  
          * @param documentId
 255  
          * @param lookFuture
 256  
          * @return
 257  
          * @throws WorkflowException
 258  
          */
 259  
         public String[] getPrincipalIdsInRouteLog(
 260  
                         @WebParam(name = "documentId") String documentId,
 261  
                         @WebParam(name = "lookFuture") boolean lookFuture)
 262  
                         throws WorkflowException;
 263  
 
 264  
         /**
 265  
          * Returns the principal ID of the initiator of the given document.
 266  
          * <b>null</b> if the document can not be found.
 267  
          * 
 268  
          * @throws WorkflowException
 269  
          */
 270  
         public String getDocumentInitiatorPrincipalId(
 271  
                         @WebParam(name = "documentId") String documentId)
 272  
                         throws WorkflowException;
 273  
 
 274  
         /**
 275  
          * Returns the principal ID of the user who routed the given document.
 276  
          * <b>null</b> if the document can not be found.
 277  
          * 
 278  
          * @throws WorkflowException
 279  
          */
 280  
         public String getDocumentRoutedByPrincipalId(
 281  
                         @WebParam(name = "documentId") String documentId)
 282  
                         throws WorkflowException;
 283  
 
 284  
         @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 285  
         public Map<String, String> getActionsRequested(
 286  
                         @WebParam(name = "principalId") String principalId,
 287  
                         @WebParam(name = "documentId") String documentId);
 288  
 
 289  
         /**
 290  
          * 
 291  
          * This method does a direct search for the searchableAttribute without
 292  
          * going through the doc search.
 293  
          * 
 294  
          * @param documentId
 295  
          * @param key
 296  
          * @return
 297  
          */
 298  
         public String[] getSearchableAttributeStringValuesByKey(
 299  
                         @WebParam(name = "documentId") String documentId,
 300  
                         @WebParam(name = "key") String key);
 301  
 
 302  
         /**
 303  
          * 
 304  
          * This method does a direct search for the searchableAttribute without
 305  
          * going through the doc search.
 306  
          * 
 307  
          * @param documentId
 308  
          * @param key
 309  
          * @return
 310  
          */
 311  
         @XmlJavaTypeAdapter(value = SqlTimestampAdapter.class)
 312  
         public Timestamp[] getSearchableAttributeDateTimeValuesByKey(
 313  
                         @WebParam(name = "documentId") String documentId,
 314  
                         @WebParam(name = "key") String key);
 315  
 
 316  
         /**
 317  
          * 
 318  
          * This method does a direct search for the searchableAttribute without
 319  
          * going through the doc search.
 320  
          * 
 321  
          * @param documentId
 322  
          * @param key
 323  
          * @return
 324  
          */
 325  
         public BigDecimal[] getSearchableAttributeFloatValuesByKey(
 326  
                         @WebParam(name = "documentId") String documentId,
 327  
                         @WebParam(name = "key") String key);
 328  
 
 329  
         /**
 330  
          * 
 331  
          * This method does a direct search for the searchableAttribute without
 332  
          * going through the doc search.
 333  
          * 
 334  
          * @param documentId
 335  
          * @param key
 336  
          * @return
 337  
          */
 338  
         public Long[] getSearchableAttributeLongValuesByKey(
 339  
                         @WebParam(name = "documentId") String documentId,
 340  
                         @WebParam(name = "key") String key);
 341  
 
 342  
         public String getFutureRequestsKey(
 343  
                         @WebParam(name = "principalId") String principalId);
 344  
 
 345  
         public String getReceiveFutureRequestsValue();
 346  
 
 347  
         public String getDoNotReceiveFutureRequestsValue();
 348  
 
 349  
         public String getClearFutureRequestsValue();
 350  
                         
 351  
     // new for 1.0.kc
 352  
     public DocumentStatusTransitionDTO[] getDocumentStatusTransitionHistory(
 353  
                     @WebParam(name = "documentId") String documentId)
 354  
                     throws WorkflowException;
 355  
     
 356  
     //for docmentlink
 357  
     public void addDocumentLink(DocumentLinkDTO docLinkVO) throws WorkflowException;
 358  
 
 359  
     public void deleteDocumentLink(DocumentLinkDTO docLinkVO) throws WorkflowException;
 360  
     
 361  
     public void deleteDocumentLinksByDocId(String docId) throws WorkflowException;
 362  
     
 363  
     public List<DocumentLinkDTO> getLinkedDocumentsByDocId(String documentId) throws WorkflowException;
 364  
     
 365  
     public DocumentLinkDTO getLinkedDocument(DocumentLinkDTO docLinkVO) throws WorkflowException;
 366  
 
 367  
 }