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