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.util.jaxb.MapStringStringAdapter;
 20  
 import org.kuali.rice.core.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 getDocumentDetailFromAppId(String documentTypeName, String appId) throws WorkflowException;
 59  
 
 60  
         public DocumentDetailDTO getDocumentDetail(
 61  
                         @WebParam(name = "documentId") String documentId)
 62  
                         throws WorkflowException;
 63  
 
 64  
         public RouteNodeInstanceDTO getNodeInstance(
 65  
                         @WebParam(name = "nodeInstanceId") String nodeInstanceId)
 66  
                         throws WorkflowException;
 67  
 
 68  
         public String getNewResponsibilityId() throws WorkflowException;
 69  
 
 70  
         public Integer getUserActionItemCount(
 71  
                         @WebParam(name = "principalId") String principalId)
 72  
                         throws WorkflowException;
 73  
 
 74  
         public ActionItemDTO[] getAllActionItems(
 75  
                         @WebParam(name = "documentId") String documentId)
 76  
                         throws WorkflowException;
 77  
 
 78  
         public ActionItemDTO[] getActionItems(
 79  
                         @WebParam(name = "documentId") String documentId,
 80  
                         @WebParam(name = "actionRequestedCodes") String[] actionRequestedCodes)
 81  
                         throws WorkflowException;
 82  
 
 83  
         public ActionRequestDTO[] getAllActionRequests(
 84  
                         @WebParam(name = "documentId") String documentId)
 85  
                         throws WorkflowException;
 86  
 
 87  
         public ActionRequestDTO[] getActionRequests(
 88  
                         @WebParam(name = "documentId") String documentId,
 89  
                         @WebParam(name = "nodeName") String nodeName,
 90  
                         @WebParam(name = "principalId") String principalId)
 91  
                         throws WorkflowException;
 92  
 
 93  
         public ActionTakenDTO[] getActionsTaken(
 94  
                         @WebParam(name = "documentId") String documentId)
 95  
                         throws WorkflowException;
 96  
 
 97  
         public WorkflowAttributeValidationErrorDTO[] validateWorkflowAttributeDefinitionVO(
 98  
                         @WebParam(name = "definition") WorkflowAttributeDefinitionDTO definition)
 99  
                         throws WorkflowException;
 100  
 
 101  
         public boolean isUserInRouteLog(
 102  
                         @WebParam(name = "documentId") String documentId,
 103  
                         @WebParam(name = "principalId") String principalId,
 104  
                         @WebParam(name = "lookFuture") boolean lookFuture)
 105  
                         throws WorkflowException;
 106  
 
 107  
         public boolean isUserInRouteLogWithOptionalFlattening(
 108  
                         @WebParam(name = "documentId") String documentId,
 109  
                         @WebParam(name = "principalId") String principalId,
 110  
                         @WebParam(name = "lookFuture") boolean lookFuture,
 111  
                         @WebParam(name = "flattenNodes") boolean flattenNodes)
 112  
                         throws WorkflowException;
 113  
 
 114  
         public void reResolveRoleByDocTypeName(
 115  
                         @WebParam(name = "documentTypeName") String documentTypeName,
 116  
                         @WebParam(name = "roleName") String roleName,
 117  
                         @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel)
 118  
                         throws WorkflowException;
 119  
 
 120  
         public void reResolveRoleByDocumentId(
 121  
                         @WebParam(name = "documentId") String documentId,
 122  
                         @WebParam(name = "roleName") String roleName,
 123  
                         @WebParam(name = "qualifiedRoleNameLabel") String qualifiedRoleNameLabel)
 124  
                         throws WorkflowException;
 125  
 
 126  
         public DocumentDetailDTO routingReport(
 127  
                         @WebParam(name = "reportCriteria") ReportCriteriaDTO reportCriteria)
 128  
                         throws WorkflowException;
 129  
 
 130  
         public boolean isFinalApprover(
 131  
                         @WebParam(name = "documentId") String documentId,
 132  
                         @WebParam(name = "principalId") String principalId)
 133  
                         throws WorkflowException;
 134  
 
 135  
         public boolean isSuperUserForDocumentType(
 136  
                         @WebParam(name = "principalId") String principalId,
 137  
                         @WebParam(name = "documentTypeId") String documentTypeId)
 138  
                         throws WorkflowException;
 139  
 
 140  
         public String getAppDocId(
 141  
                         @WebParam(name = "documentId") String documentId);
 142  
         
 143  
         public DocumentSearchResultDTO performDocumentSearch(
 144  
                         @WebParam(name = "criteriaVO") DocumentSearchCriteriaDTO criteriaVO)
 145  
                         throws WorkflowException;
 146  
 
 147  
         public DocumentSearchResultDTO performDocumentSearchWithPrincipal(
 148  
                         @WebParam(name = "principalId") String principalId,
 149  
                         @WebParam(name = "criteriaVO") DocumentSearchCriteriaDTO criteriaVO)
 150  
                         throws WorkflowException;
 151  
 
 152  
         // new in 2.3
 153  
 
 154  
         public RuleDTO[] ruleReport(
 155  
                         @WebParam(name = "ruleReportCriteria") RuleReportCriteriaDTO ruleReportCriteria)
 156  
                         throws WorkflowException;
 157  
 
 158  
         // deprecated as of 2.1
 159  
 
 160  
         /**
 161  
          * @deprecated use isLastApproverAtNode instead
 162  
          */
 163  
         public boolean isLastApproverInRouteLevel(
 164  
                         @WebParam(name = "documentId") String documentId,
 165  
                         @WebParam(name = "principalId") String principalId,
 166  
                         @WebParam(name = "routeLevel") Integer routeLevel)
 167  
                         throws WorkflowException;
 168  
 
 169  
         /**
 170  
          * @deprecated use routeNodeHasApproverActionRequest instead
 171  
          */
 172  
         public boolean routeLevelHasApproverActionRequest(
 173  
                         @WebParam(name = "docType") String docType,
 174  
                         @WebParam(name = "docContent") String docContent,
 175  
                         @WebParam(name = "routeLevel") Integer routeLevel)
 176  
                         throws WorkflowException;
 177  
 
 178  
         // new in 2.1
 179  
 
 180  
         public boolean isLastApproverAtNode(
 181  
                         @WebParam(name = "documentId") String documentId,
 182  
                         @WebParam(name = "principalId") String principalId,
 183  
                         @WebParam(name = "nodeName") String nodeName)
 184  
                         throws WorkflowException;
 185  
 
 186  
         public boolean routeNodeHasApproverActionRequest(
 187  
                         @WebParam(name = "docType") String docType,
 188  
                         @WebParam(name = "docContent") String docContent,
 189  
                         @WebParam(name = "nodeName") String nodeName)
 190  
                         throws WorkflowException;
 191  
 
 192  
         public RouteNodeInstanceDTO[] getDocumentRouteNodeInstances(
 193  
                         @WebParam(name = "documentId") String documentId)
 194  
                         throws WorkflowException;
 195  
 
 196  
         public RouteNodeInstanceDTO[] getActiveNodeInstances(
 197  
                         @WebParam(name = "documentId") String documentId)
 198  
                         throws WorkflowException;
 199  
 
 200  
         public RouteNodeInstanceDTO[] getTerminalNodeInstances(
 201  
                         @WebParam(name = "documentId") String documentId)
 202  
                         throws WorkflowException;
 203  
 
 204  
         public DocumentContentDTO getDocumentContent(
 205  
                         @WebParam(name = "documentId") String documentId)
 206  
                         throws WorkflowException;
 207  
 
 208  
         // 2.2
 209  
         public String[] getPreviousRouteNodeNames(
 210  
                         @WebParam(name = "documentId") String documentId)
 211  
                         throws WorkflowException;
 212  
 
 213  
         // 2.4
 214  
         public boolean documentWillHaveAtLeastOneActionRequest(
 215  
                         @WebParam(name = "reportCriteriaDTO") ReportCriteriaDTO reportCriteriaDTO,
 216  
                         @WebParam(name = "actionRequestedCodes") String[] actionRequestedCodes,
 217  
                         @WebParam(name = "ignoreCurrentActionRequests") boolean ignoreCurrentActionRequests);
 218  
 
 219  
         /**
 220  
          * @since 0.9.1
 221  
          */
 222  
         public String getDocumentStatus(
 223  
                         @WebParam(name = "documentId") String documentId)
 224  
                         throws WorkflowException;
 225  
 
 226  
         public RouteNodeInstanceDTO[] getCurrentNodeInstances(
 227  
                         @WebParam(name = "documentId") String documentId)
 228  
                         throws WorkflowException;
 229  
 
 230  
         // added for KS per Scott
 231  
         ActionItemDTO[] getActionItemsForPrincipal(
 232  
                         @WebParam(name = "principalId") String principalId)
 233  
                         throws WorkflowException;
 234  
 
 235  
         /**
 236  
          * 
 237  
          * This method gets a list of ids of all principals who have a pending
 238  
          * action request for a document.
 239  
          * 
 240  
          * @param actionRequestedCd
 241  
          * @param documentId
 242  
          * @return
 243  
          * @throws WorkflowException
 244  
          */
 245  
         public String[] getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(
 246  
                         @WebParam(name = "actionRequestedCd") String actionRequestedCd,
 247  
                         @WebParam(name = "documentId") String documentId)
 248  
                         throws WorkflowException;
 249  
 
 250  
         /**
 251  
          * This method gets a list of ids of all principals in the route log - -
 252  
          * initiators, - people who have taken action, - people with a pending
 253  
          * action request, - people who will receive an action request for the
 254  
          * document in question
 255  
          * 
 256  
          * @param documentId
 257  
          * @param lookFuture
 258  
          * @return
 259  
          * @throws WorkflowException
 260  
          */
 261  
         public String[] getPrincipalIdsInRouteLog(
 262  
                         @WebParam(name = "documentId") String documentId,
 263  
                         @WebParam(name = "lookFuture") boolean lookFuture)
 264  
                         throws WorkflowException;
 265  
 
 266  
         /**
 267  
          * Returns the principal ID of the initiator of the given document.
 268  
          * <b>null</b> if the document can not be found.
 269  
          * 
 270  
          * @throws WorkflowException
 271  
          */
 272  
         public String getDocumentInitiatorPrincipalId(
 273  
                         @WebParam(name = "documentId") String documentId)
 274  
                         throws WorkflowException;
 275  
 
 276  
         /**
 277  
          * Returns the principal ID of the user who routed the given document.
 278  
          * <b>null</b> if the document can not be found.
 279  
          * 
 280  
          * @throws WorkflowException
 281  
          */
 282  
         public String getDocumentRoutedByPrincipalId(
 283  
                         @WebParam(name = "documentId") String documentId)
 284  
                         throws WorkflowException;
 285  
 
 286  
         @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
 287  
         public Map<String, String> getActionsRequested(
 288  
                         @WebParam(name = "principalId") String principalId,
 289  
                         @WebParam(name = "documentId") String documentId);
 290  
 
 291  
         /**
 292  
          * 
 293  
          * This method does a direct search for the searchableAttribute without
 294  
          * going through the doc search.
 295  
          * 
 296  
          * @param documentId
 297  
          * @param key
 298  
          * @return
 299  
          */
 300  
         public String[] getSearchableAttributeStringValuesByKey(
 301  
                         @WebParam(name = "documentId") String documentId,
 302  
                         @WebParam(name = "key") String key);
 303  
 
 304  
         /**
 305  
          * 
 306  
          * This method does a direct search for the searchableAttribute without
 307  
          * going through the doc search.
 308  
          * 
 309  
          * @param documentId
 310  
          * @param key
 311  
          * @return
 312  
          */
 313  
         @XmlJavaTypeAdapter(value = SqlTimestampAdapter.class)
 314  
         public Timestamp[] getSearchableAttributeDateTimeValuesByKey(
 315  
                         @WebParam(name = "documentId") String documentId,
 316  
                         @WebParam(name = "key") String key);
 317  
 
 318  
         /**
 319  
          * 
 320  
          * This method does a direct search for the searchableAttribute without
 321  
          * going through the doc search.
 322  
          * 
 323  
          * @param documentId
 324  
          * @param key
 325  
          * @return
 326  
          */
 327  
         public BigDecimal[] getSearchableAttributeFloatValuesByKey(
 328  
                         @WebParam(name = "documentId") String documentId,
 329  
                         @WebParam(name = "key") String key);
 330  
 
 331  
         /**
 332  
          * 
 333  
          * This method does a direct search for the searchableAttribute without
 334  
          * going through the doc search.
 335  
          * 
 336  
          * @param documentId
 337  
          * @param key
 338  
          * @return
 339  
          */
 340  
         public Long[] getSearchableAttributeLongValuesByKey(
 341  
                         @WebParam(name = "documentId") String documentId,
 342  
                         @WebParam(name = "key") String key);
 343  
 
 344  
         public String getFutureRequestsKey(
 345  
                         @WebParam(name = "principalId") String principalId);
 346  
 
 347  
         public String getReceiveFutureRequestsValue();
 348  
 
 349  
         public String getDoNotReceiveFutureRequestsValue();
 350  
 
 351  
         public String getClearFutureRequestsValue();
 352  
                         
 353  
     // new for 1.0.kc
 354  
     public DocumentStatusTransitionDTO[] getDocumentStatusTransitionHistory(
 355  
                     @WebParam(name = "documentId") String documentId)
 356  
                     throws WorkflowException;
 357  
     
 358  
     //for docmentlink
 359  
     public void addDocumentLink(DocumentLinkDTO docLinkVO) throws WorkflowException;
 360  
 
 361  
     public void deleteDocumentLink(DocumentLinkDTO docLinkVO) throws WorkflowException;
 362  
     
 363  
     public void deleteDocumentLinksByDocId(String docId) throws WorkflowException;
 364  
     
 365  
     public List<DocumentLinkDTO> getLinkedDocumentsByDocId(String documentId) throws WorkflowException;
 366  
     
 367  
     public DocumentLinkDTO getLinkedDocument(DocumentLinkDTO docLinkVO) throws WorkflowException;
 368  
 
 369  
 }