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.core.util.AttributeSet;
 20  
 import org.kuali.rice.kew.actionrequest.ActionRequestValue;
 21  
 import org.kuali.rice.kew.actionrequest.Recipient;
 22  
 import org.kuali.rice.kew.actiontaken.ActionTakenValue;
 23  
 import org.kuali.rice.kew.engine.ActivationContext;
 24  
 import org.kuali.rice.kew.engine.node.RouteNodeInstance;
 25  
 import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
 26  
 
 27  
 import java.util.Collection;
 28  
 import java.util.List;
 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 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(Long actionRequestId);
 81  
 
 82  
     public List findPendingRootRequestsByDocId(String documentId);
 83  
 
 84  
     public List findPendingRootRequestsByDocIdAtRouteLevel(String documentId, Integer routeLevel);
 85  
 
 86  
     public List findPendingByDocIdAtOrBelowRouteLevel(String documentId, Integer routeLevel);
 87  
 
 88  
     public List findPendingRootRequestsByDocIdAtOrBelowRouteLevel(String documentId, Integer routeLevel);
 89  
 
 90  
     public List findPendingRootRequestsByDocumentType(Long documentTypeId);
 91  
 
 92  
     public List findAllActionRequestsByDocumentId(String documentId);
 93  
 
 94  
     public List findPendingByActionRequestedAndDocId(String actionRequestedCdCd, String documentId);
 95  
 
 96  
     /**
 97  
      *
 98  
      * This method gets a list of ids of all principals who have a pending action request for a document.
 99  
      *
 100  
      * @param actionRequestedCd
 101  
      * @param documentId
 102  
      * @return
 103  
      */
 104  
     public List<String> getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(String actionRequestedCd, String documentId);
 105  
 
 106  
     public List<ActionRequestValue> findByStatusAndDocId(String statusCd, String documentId);
 107  
 
 108  
     public void alterActionRequested(List actionRequests, String actionRequestCd);
 109  
 
 110  
     public List findByDocumentIdIgnoreCurrentInd(String documentId);
 111  
 
 112  
     public List findActivatedByGroup(String groupId);
 113  
 
 114  
     public void updateActionRequestsForResponsibilityChange(Set<Long> responsibilityIds);
 115  
 
 116  
     public ActionRequestValue getRoot(ActionRequestValue actionRequest);
 117  
 
 118  
     public List<ActionRequestValue> getRootRequests(Collection<ActionRequestValue> actionRequests);
 119  
 
 120  
     public boolean isDuplicateRequest(ActionRequestValue actionRequest);
 121  
 
 122  
     public List findPendingByDocRequestCdRouteLevel(String documentId, String requestCode, Integer routeLevel);
 123  
 
 124  
     public List findPendingByDocRequestCdNodeName(String documentId, String requestCode, String nodeName);
 125  
     
 126  
     /**
 127  
      * Returns all pending requests for a given routing entity
 128  
      * @param documentId the id of the document header being routed
 129  
      * @return a List of all pending ActionRequestValues for the document
 130  
      */
 131  
     public abstract List<ActionRequestValue> findAllPendingRequests(String documentId);
 132  
     
 133  
         /**
 134  
          * Filters action requests based on if they occur after the given requestCode, and if they relate to 
 135  
          * the given principal
 136  
          * @param actionRequests the List of ActionRequestValues to filter
 137  
          * @param principalId the id of the principal to find active requests for
 138  
          * @param principalGroupIds List of group ids that the principal belongs to
 139  
          * @param requestCode the request code for all ActionRequestValues to be after
 140  
          * @return the filtered List of ActionRequestValues
 141  
          */
 142  
         public abstract List<ActionRequestValue> filterActionRequestsByCode(List<ActionRequestValue> actionRequests, String principalId, List<String> principalGroupIds, String requestCode);
 143  
 
 144  
     /**
 145  
      * Returns the highest priority delegator in the list of action requests.
 146  
      */
 147  
     public Recipient findDelegator(List actionRequests);
 148  
 
 149  
     /**
 150  
      * Returns the closest delegator for the given ActionRequest
 151  
      */
 152  
     public Recipient findDelegator(ActionRequestValue actionRequest);
 153  
 
 154  
     public ActionRequestValue findDelegatorRequest(ActionRequestValue actionRequest);
 155  
 
 156  
     public void deleteByDocumentId(String documentId);
 157  
 
 158  
     public void deleteByActionRequestId(Long actionRequestId);
 159  
 
 160  
     public void validateActionRequest(ActionRequestValue actionRequest);
 161  
 
 162  
     public List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteNode(String documentId, Long nodeInstanceId);
 163  
 
 164  
     public List findRootRequestsByDocIdAtRouteNode(String documentId, Long nodeInstanceId);
 165  
 
 166  
     public List getDelegateRequests(ActionRequestValue actionRequest);
 167  
 
 168  
     /**
 169  
      * If this is a role request, then this method returns a List of the action request for each recipient within the
 170  
      * role.  Otherwise, it will return a List with just the original action request.
 171  
      */
 172  
     public List getTopLevelRequests(ActionRequestValue actionRequest);
 173  
 
 174  
     public boolean isValidActionRequestCode(String actionRequestCode);
 175  
 
 176  
     /**
 177  
      * Checks if the given user has any Action Requests on the given document.
 178  
      */
 179  
     public boolean doesPrincipalHaveRequest(String principalId, String documentId);
 180  
 
 181  
     public AttributeSet getActionsRequested(DocumentRouteHeaderValue routeHeader, String principalId, boolean completeAndApproveTheSame);
 182  
 }