Coverage Report - org.kuali.rice.kew.actionrequest.service.ActionRequestService
 
Classes in this File Line Coverage Branch Coverage Complexity
ActionRequestService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 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.actionrequest.service;
 18  
 
 19  
 import org.kuali.rice.kew.actionrequest.ActionRequestValue;
 20  
 import org.kuali.rice.kew.actionrequest.Recipient;
 21  
 import org.kuali.rice.kew.actiontaken.ActionTakenValue;
 22  
 import org.kuali.rice.kew.engine.ActivationContext;
 23  
 import org.kuali.rice.kew.engine.node.RouteNodeInstance;
 24  
 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
 25  
 
 26  
 import java.util.Collection;
 27  
 import java.util.List;
 28  
 import java.util.Map;
 29  
 import java.util.Set;
 30  
 
 31  
 /**
 32  
  * Service to handle the building, sorting, saving, activating and deactivating of action request graphs.  These lists are
 33  
  * what determine role and delegation behaviors in graphs of action requests.
 34  
  *
 35  
  * Fetching that is being done is also taking into account the 'weight' of action request codes.
 36  
  *
 37  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 38  
  */
 39  
 public interface ActionRequestService {
 40  
         public ActionRequestValue initializeActionRequestGraph(ActionRequestValue actionRequest, DocumentRouteHeaderValue document, RouteNodeInstance nodeInstance);
 41  
 
 42  
     public void deactivateRequest(ActionTakenValue actionTaken, ActionRequestValue actionRequest);
 43  
 
 44  
     public void deactivateRequests(ActionTakenValue actionTaken, List actionRequests);
 45  
 
 46  
     public void deactivateRequest(ActionTakenValue actionTaken, ActionRequestValue actionRequest, boolean simulate);
 47  
 
 48  
     public void deactivateRequest(ActionTakenValue actionTaken, ActionRequestValue actionRequest, ActivationContext activationContext);
 49  
 
 50  
     public void deactivateRequests(ActionTakenValue actionTaken, List actionRequests, boolean simulate);
 51  
 
 52  
     public void deactivateRequests(ActionTakenValue actionTaken, List actionRequests, ActivationContext activationContext);
 53  
 
 54  
     public void deleteActionRequestGraph(ActionRequestValue actionRequest);
 55  
 
 56  
     public List findAllValidRequests(String principalId, String documentId, String requestCode);
 57  
 
 58  
     public List findAllValidRequests(String principalId, Collection actionRequests, String requestCode);
 59  
 
 60  
     public List<ActionRequestValue> findPendingByDoc(String documentId);
 61  
 
 62  
     public void saveActionRequest(ActionRequestValue actionRequest);
 63  
 
 64  
     public void activateRequest(ActionRequestValue actionRequest);
 65  
 
 66  
     public void activateRequest(ActionRequestValue actionRequest, boolean simulate);
 67  
 
 68  
     public void activateRequest(ActionRequestValue actionRequest, ActivationContext activationContext);
 69  
 
 70  
     public void activateRequests(Collection actionRequests);
 71  
 
 72  
     public void activateRequests(Collection actionRequests, boolean simulate);
 73  
 
 74  
         public void activateRequests(Collection actionRequests, ActivationContext activationContext);
 75  
 
 76  
     public List activateRequestNoNotification(ActionRequestValue actionRequest, boolean simulate);
 77  
 
 78  
     public List activateRequestNoNotification(ActionRequestValue actionRequest, ActivationContext activationContext);
 79  
 
 80  
     public ActionRequestValue findByActionRequestId(String actionRequestId);
 81  
 
 82  
     public List<ActionRequestValue> findPendingRootRequestsByDocId(String documentId);
 83  
 
 84  
     public List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteLevel(String documentId, Integer routeLevel);
 85  
 
 86  
     public List<ActionRequestValue> findPendingByDocIdAtOrBelowRouteLevel(String documentId, Integer routeLevel);
 87  
 
 88  
     public List<ActionRequestValue> findPendingRootRequestsByDocIdAtOrBelowRouteLevel(String documentId, Integer routeLevel);
 89  
 
 90  
     public List<ActionRequestValue> findPendingRootRequestsByDocumentType(String documentTypeId);
 91  
 
 92  
     public List<ActionRequestValue> findAllActionRequestsByDocumentId(String documentId);
 93  
     
 94  
     public List<ActionRequestValue> findAllRootActionRequestsByDocumentId(String documentId);
 95  
 
 96  
     public List<ActionRequestValue> findPendingByActionRequestedAndDocId(String actionRequestedCdCd, String documentId);
 97  
 
 98  
     /**
 99  
      *
 100  
      * This method gets a list of ids of all principals who have a pending action request for a document.
 101  
      *
 102  
      * @param actionRequestedCd
 103  
      * @param documentId
 104  
      * @return
 105  
      */
 106  
     public List<String> getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(String actionRequestedCd, String documentId);
 107  
 
 108  
     public List<ActionRequestValue> findByStatusAndDocId(String statusCd, String documentId);
 109  
 
 110  
     public void alterActionRequested(List actionRequests, String actionRequestCd);
 111  
 
 112  
     public List<ActionRequestValue> findByDocumentIdIgnoreCurrentInd(String documentId);
 113  
 
 114  
     public List findActivatedByGroup(String groupId);
 115  
 
 116  
     public void updateActionRequestsForResponsibilityChange(Set<String> responsibilityIds);
 117  
 
 118  
     public ActionRequestValue getRoot(ActionRequestValue actionRequest);
 119  
 
 120  
     public List<ActionRequestValue> getRootRequests(Collection<ActionRequestValue> actionRequests);
 121  
 
 122  
     public boolean isDuplicateRequest(ActionRequestValue actionRequest);
 123  
 
 124  
     public List<ActionRequestValue> findPendingByDocRequestCdRouteLevel(String documentId, String requestCode, Integer routeLevel);
 125  
 
 126  
     public List findPendingByDocRequestCdNodeName(String documentId, String requestCode, String nodeName);
 127  
     
 128  
     /**
 129  
      * Returns all pending requests for a given routing entity
 130  
      * @param documentId the id of the document header being routed
 131  
      * @return a List of all pending ActionRequestValues for the document
 132  
      */
 133  
     public abstract List<ActionRequestValue> findAllPendingRequests(String documentId);
 134  
     
 135  
         /**
 136  
          * Filters action requests based on if they occur after the given requestCode, and if they relate to 
 137  
          * the given principal
 138  
          * @param actionRequests the List of ActionRequestValues to filter
 139  
          * @param principalId the id of the principal to find active requests for
 140  
          * @param principalGroupIds List of group ids that the principal belongs to
 141  
          * @param requestCode the request code for all ActionRequestValues to be after
 142  
          * @return the filtered List of ActionRequestValues
 143  
          */
 144  
         public abstract List<ActionRequestValue> filterActionRequestsByCode(List<ActionRequestValue> actionRequests, String principalId, List<String> principalGroupIds, String requestCode);
 145  
 
 146  
     /**
 147  
      * Returns the highest priority delegator in the list of action requests.
 148  
      */
 149  
     public Recipient findDelegator(List actionRequests);
 150  
 
 151  
     /**
 152  
      * Returns the closest delegator for the given ActionRequest
 153  
      */
 154  
     public Recipient findDelegator(ActionRequestValue actionRequest);
 155  
 
 156  
     public ActionRequestValue findDelegatorRequest(ActionRequestValue actionRequest);
 157  
 
 158  
     public void deleteByDocumentId(String documentId);
 159  
 
 160  
     public void deleteByActionRequestId(String actionRequestId);
 161  
 
 162  
     public void validateActionRequest(ActionRequestValue actionRequest);
 163  
 
 164  
     public List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteNode(String documentId, String nodeInstanceId);
 165  
 
 166  
     public List<ActionRequestValue> findRootRequestsByDocIdAtRouteNode(String documentId, String nodeInstanceId);
 167  
 
 168  
     public List getDelegateRequests(ActionRequestValue actionRequest);
 169  
 
 170  
     /**
 171  
      * If this is a role request, then this method returns a List of the action request for each recipient within the
 172  
      * role.  Otherwise, it will return a List with just the original action request.
 173  
      */
 174  
     public List getTopLevelRequests(ActionRequestValue actionRequest);
 175  
 
 176  
     public boolean isValidActionRequestCode(String actionRequestCode);
 177  
 
 178  
     /**
 179  
      * Checks if the given user has any Action Requests on the given document.
 180  
      */
 181  
     public boolean doesPrincipalHaveRequest(String principalId, String documentId);
 182  
 
 183  
     public Map<String, String> getActionsRequested(DocumentRouteHeaderValue routeHeader, String principalId, boolean completeAndApproveTheSame);
 184  
 }