org.kuali.rice.kew.actionrequest.service.impl
Class ActionRequestServiceImpl

java.lang.Object
  extended by org.kuali.rice.kew.actionrequest.service.impl.ActionRequestServiceImpl
All Implemented Interfaces:
ActionRequestService

public class ActionRequestServiceImpl
extends Object
implements ActionRequestService

Default implementation of the ActionRequestService.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
ActionRequestServiceImpl()
           
 
Method Summary
 void activateRequest(ActionRequestValue actionRequest)
           
 void activateRequest(ActionRequestValue actionRequest, ActivationContext activationContext)
           
 void activateRequest(ActionRequestValue actionRequest, boolean simulate)
           
 List activateRequestNoNotification(ActionRequestValue actionRequest, ActivationContext activationContext)
           
 List activateRequestNoNotification(ActionRequestValue actionRequest, boolean simulate)
           
 void activateRequests(Collection actionRequests)
           
 void activateRequests(Collection actionRequests, ActivationContext activationContext)
           
 void activateRequests(Collection actionRequests, boolean simulate)
           
 void alterActionRequested(List actionRequests, String actionRequestCd)
           
protected  boolean deactivateOnActionAlreadyTaken(ActionRequestValue actionRequestToActivate, ActivationContext activationContext)
           
protected  boolean deactivateOnEmptyGroup(ActionRequestValue actionRequestToActivate, ActivationContext activationContext)
          Checks if the action request which is being activated has a group with no members.
protected  boolean deactivateOnInactiveGroup(ActionRequestValue actionRequestToActivate, ActivationContext activationContext)
          Checks if the action request which is being activated is being assigned to an inactive group.
 void deactivateRequest(ActionTakenValue actionTaken, ActionRequestValue actionRequest)
           
 void deactivateRequest(ActionTakenValue actionTaken, ActionRequestValue actionRequest, ActivationContext activationContext)
           
 void deactivateRequest(ActionTakenValue actionTaken, ActionRequestValue actionRequest, boolean simulate)
           
 void deactivateRequests(ActionTakenValue actionTaken, List actionRequests)
           
 void deactivateRequests(ActionTakenValue actionTaken, List actionRequests, ActivationContext activationContext)
           
 void deactivateRequests(ActionTakenValue actionTaken, List actionRequests, boolean simulate)
           
 void deleteActionRequestGraph(ActionRequestValue actionRequest)
          Deletes an action request and all of its action items following the graph down through the action request's children.
 void deleteByActionRequestId(String actionRequestId)
           
 void deleteByDocumentId(String documentId)
           
 boolean doesPrincipalHaveRequest(String principalId, String documentId)
          Checks if the given user has any Action Requests on the given document.
 List<ActionRequestValue> filterActionRequestsByCode(List<ActionRequestValue> actionRequests, String principalId, List<String> principalGroupIds, String requestCode)
          Filters action requests based on if they occur after the given requestCode, and if they relate to the given principal
 List findActivatedByGroup(String groupId)
           
 List<ActionRequestValue> findAllActionRequestsByDocumentId(String documentId)
           
 List<ActionRequestValue> findAllPendingRequests(String documentId)
          Returns all pending requests for a given routing identity
 List<ActionRequestValue> findAllRootActionRequestsByDocumentId(String documentId)
           
 List findAllValidRequests(String principalId, Collection actionRequests, String requestCode)
           
 List findAllValidRequests(String principalId, String documentId, String requestCode)
           
 ActionRequestValue findByActionRequestId(String actionRequestId)
           
 List<ActionRequestValue> findByDocumentIdIgnoreCurrentInd(String documentId)
           
 List<ActionRequestValue> findByStatusAndDocId(String statusCd, String documentId)
           
 Recipient findDelegator(ActionRequestValue actionRequest)
          Returns the closest delegator for the given ActionRequest
 Recipient findDelegator(List actionRequests)
          Returns the highest priority delegator in the list of action requests.
 ActionRequestValue findDelegatorRequest(ActionRequestValue actionRequest)
           
 List<ActionRequestValue> findPendingByActionRequestedAndDocId(String actionRequestedCd, String documentId)
           
 List<ActionRequestValue> findPendingByDoc(String documentId)
           
 List<ActionRequestValue> findPendingByDocIdAtOrBelowRouteLevel(String documentId, Integer routeLevel)
           
 List<ActionRequestValue> findPendingByDocRequestCdNodeName(String documentId, String requestCode, String nodeName)
           
 List<ActionRequestValue> findPendingByDocRequestCdRouteLevel(String documentId, String requestCode, Integer routeLevel)
           
 List<ActionRequestValue> findPendingRootRequestsByDocId(String documentId)
           
 List<ActionRequestValue> findPendingRootRequestsByDocIdAtOrBelowRouteLevel(String documentId, Integer routeLevel)
           
 List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteLevel(String documentId, Integer routeLevel)
           
 List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteNode(String documentId, String nodeInstanceId)
           
 List<ActionRequestValue> findPendingRootRequestsByDocumentType(String documentTypeId)
           
 List<ActionRequestValue> findRootRequestsByDocIdAtRouteNode(String documentId, String nodeInstanceId)
           
 ActionRequestDAO getActionRequestDAO()
           
 ActionRequestValue getActionRequestForRole(String actionTakenId)
           
 Map<String,String> getActionsRequested(DocumentRouteHeaderValue routeHeader, String principalId, boolean completeAndApproveTheSame)
           
protected  Map<String,String> getActionsRequested(String principalId, List<ActionRequestValue> actionRequests, boolean completeAndApproveTheSame)
          Returns a Map of actions that are requested for the given principalId in the given list of action requests.
 List getDelegateRequests(ActionRequestValue actionRequest)
           
 List<String> getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(String actionRequestedCd, String documentId)
          This method gets a list of ids of all principals who have a pending action request for a document.
 ActionRequestValue getRoot(ActionRequestValue actionRequest)
           
 List<ActionRequestValue> getRootRequests(Collection<ActionRequestValue> actionRequests)
           
 List getTopLevelRequests(ActionRequestValue actionRequest)
          If this is a role request, then this method returns a List of the action request for each recipient within the role.
 ActionRequestValue initializeActionRequestGraph(ActionRequestValue actionRequest, DocumentRouteHeaderValue document, RouteNodeInstance nodeInstance)
           
 boolean isDuplicateRequest(ActionRequestValue actionRequest)
           
 boolean isValidActionRequestCode(String actionRequestCode)
           
 void saveActionRequest(ActionRequestValue actionRequest)
           
 void setActionRequestDAO(ActionRequestDAO actionRequestDAO)
           
 void updateActionRequestsForResponsibilityChange(Set<String> responsibilityIds)
           
 void validateActionRequest(ActionRequestValue actionRequest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionRequestServiceImpl

public ActionRequestServiceImpl()
Method Detail

findByActionRequestId

public ActionRequestValue findByActionRequestId(String actionRequestId)
Specified by:
findByActionRequestId in interface ActionRequestService

getActionsRequested

public Map<String,String> getActionsRequested(DocumentRouteHeaderValue routeHeader,
                                              String principalId,
                                              boolean completeAndApproveTheSame)
Specified by:
getActionsRequested in interface ActionRequestService

getActionsRequested

protected Map<String,String> getActionsRequested(String principalId,
                                                 List<ActionRequestValue> actionRequests,
                                                 boolean completeAndApproveTheSame)
Returns a Map of actions that are requested for the given principalId in the given list of action requests.

Parameters:
principalId -
actionRequests -
completeAndApproveTheSame -
Returns:

initializeActionRequestGraph

public ActionRequestValue initializeActionRequestGraph(ActionRequestValue actionRequest,
                                                       DocumentRouteHeaderValue document,
                                                       RouteNodeInstance nodeInstance)
Specified by:
initializeActionRequestGraph in interface ActionRequestService

activateRequests

public void activateRequests(Collection actionRequests)
Specified by:
activateRequests in interface ActionRequestService

activateRequests

public void activateRequests(Collection actionRequests,
                             boolean simulate)
Specified by:
activateRequests in interface ActionRequestService

activateRequests

public void activateRequests(Collection actionRequests,
                             ActivationContext activationContext)
Specified by:
activateRequests in interface ActionRequestService

activateRequest

public void activateRequest(ActionRequestValue actionRequest)
Specified by:
activateRequest in interface ActionRequestService

activateRequest

public void activateRequest(ActionRequestValue actionRequest,
                            boolean simulate)
Specified by:
activateRequest in interface ActionRequestService

activateRequest

public void activateRequest(ActionRequestValue actionRequest,
                            ActivationContext activationContext)
Specified by:
activateRequest in interface ActionRequestService

activateRequestNoNotification

public List activateRequestNoNotification(ActionRequestValue actionRequest,
                                          boolean simulate)
Specified by:
activateRequestNoNotification in interface ActionRequestService

activateRequestNoNotification

public List activateRequestNoNotification(ActionRequestValue actionRequest,
                                          ActivationContext activationContext)
Specified by:
activateRequestNoNotification in interface ActionRequestService

deactivateOnActionAlreadyTaken

protected boolean deactivateOnActionAlreadyTaken(ActionRequestValue actionRequestToActivate,
                                                 ActivationContext activationContext)

deactivateOnEmptyGroup

protected boolean deactivateOnEmptyGroup(ActionRequestValue actionRequestToActivate,
                                         ActivationContext activationContext)
Checks if the action request which is being activated has a group with no members. If this is the case then it will immediately initiate de-activation on the request since a group with no members will result in no action items being generated so should be effectively skipped.


deactivateOnInactiveGroup

protected boolean deactivateOnInactiveGroup(ActionRequestValue actionRequestToActivate,
                                            ActivationContext activationContext)
Checks if the action request which is being activated is being assigned to an inactive group. If this is the case and if the FailOnInactiveGroup policy is set to false then it will immediately initiate de-activation on the request


deactivateRequest

public void deactivateRequest(ActionTakenValue actionTaken,
                              ActionRequestValue actionRequest)
Specified by:
deactivateRequest in interface ActionRequestService

deactivateRequest

public void deactivateRequest(ActionTakenValue actionTaken,
                              ActionRequestValue actionRequest,
                              boolean simulate)
Specified by:
deactivateRequest in interface ActionRequestService

deactivateRequest

public void deactivateRequest(ActionTakenValue actionTaken,
                              ActionRequestValue actionRequest,
                              ActivationContext activationContext)
Specified by:
deactivateRequest in interface ActionRequestService

deactivateRequests

public void deactivateRequests(ActionTakenValue actionTaken,
                               List actionRequests)
Specified by:
deactivateRequests in interface ActionRequestService

deactivateRequests

public void deactivateRequests(ActionTakenValue actionTaken,
                               List actionRequests,
                               boolean simulate)
Specified by:
deactivateRequests in interface ActionRequestService

deactivateRequests

public void deactivateRequests(ActionTakenValue actionTaken,
                               List actionRequests,
                               ActivationContext activationContext)
Specified by:
deactivateRequests in interface ActionRequestService

getRootRequests

public List<ActionRequestValue> getRootRequests(Collection<ActionRequestValue> actionRequests)
Specified by:
getRootRequests in interface ActionRequestService

getRoot

public ActionRequestValue getRoot(ActionRequestValue actionRequest)
Specified by:
getRoot in interface ActionRequestService

findAllPendingRequests

public List<ActionRequestValue> findAllPendingRequests(String documentId)
Returns all pending requests for a given routing identity

Specified by:
findAllPendingRequests in interface ActionRequestService
Parameters:
documentId - the id of the document header being routed
Returns:
a List of all pending ActionRequestValues for the document

findAllValidRequests

public List findAllValidRequests(String principalId,
                                 String documentId,
                                 String requestCode)
Specified by:
findAllValidRequests in interface ActionRequestService

findAllValidRequests

public List findAllValidRequests(String principalId,
                                 Collection actionRequests,
                                 String requestCode)
Specified by:
findAllValidRequests in interface ActionRequestService

filterActionRequestsByCode

public List<ActionRequestValue> filterActionRequestsByCode(List<ActionRequestValue> actionRequests,
                                                           String principalId,
                                                           List<String> principalGroupIds,
                                                           String requestCode)
Filters action requests based on if they occur after the given requestCode, and if they relate to the given principal

Specified by:
filterActionRequestsByCode in interface ActionRequestService
Parameters:
actionRequests - the List of ActionRequestValues to filter
principalId - the id of the principal to find active requests for
principalGroupIds - List of group ids that the principal belongs to
requestCode - the request code for all ActionRequestValues to be after
Returns:
the filtered List of ActionRequestValues

updateActionRequestsForResponsibilityChange

public void updateActionRequestsForResponsibilityChange(Set<String> responsibilityIds)
Specified by:
updateActionRequestsForResponsibilityChange in interface ActionRequestService

deleteActionRequestGraph

public void deleteActionRequestGraph(ActionRequestValue actionRequest)
Deletes an action request and all of its action items following the graph down through the action request's children. This method should be invoked on a top-level action request.

Specified by:
deleteActionRequestGraph in interface ActionRequestService

findByDocumentIdIgnoreCurrentInd

public List<ActionRequestValue> findByDocumentIdIgnoreCurrentInd(String documentId)
Specified by:
findByDocumentIdIgnoreCurrentInd in interface ActionRequestService

findAllActionRequestsByDocumentId

public List<ActionRequestValue> findAllActionRequestsByDocumentId(String documentId)
Specified by:
findAllActionRequestsByDocumentId in interface ActionRequestService

findAllRootActionRequestsByDocumentId

public List<ActionRequestValue> findAllRootActionRequestsByDocumentId(String documentId)
Specified by:
findAllRootActionRequestsByDocumentId in interface ActionRequestService

findPendingByActionRequestedAndDocId

public List<ActionRequestValue> findPendingByActionRequestedAndDocId(String actionRequestedCd,
                                                                     String documentId)
Specified by:
findPendingByActionRequestedAndDocId in interface ActionRequestService

getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId

public List<String> getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(String actionRequestedCd,
                                                                                     String documentId)
Description copied from interface: ActionRequestService
This method gets a list of ids of all principals who have a pending action request for a document.

Specified by:
getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId in interface ActionRequestService
Returns:
See Also:
ActionRequestService.getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(java.lang.String, java.lang.String)

findPendingByDocIdAtOrBelowRouteLevel

public List<ActionRequestValue> findPendingByDocIdAtOrBelowRouteLevel(String documentId,
                                                                      Integer routeLevel)
Specified by:
findPendingByDocIdAtOrBelowRouteLevel in interface ActionRequestService

findPendingRootRequestsByDocId

public List<ActionRequestValue> findPendingRootRequestsByDocId(String documentId)
Specified by:
findPendingRootRequestsByDocId in interface ActionRequestService

findPendingRootRequestsByDocIdAtRouteNode

public List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteNode(String documentId,
                                                                          String nodeInstanceId)
Specified by:
findPendingRootRequestsByDocIdAtRouteNode in interface ActionRequestService

findRootRequestsByDocIdAtRouteNode

public List<ActionRequestValue> findRootRequestsByDocIdAtRouteNode(String documentId,
                                                                   String nodeInstanceId)
Specified by:
findRootRequestsByDocIdAtRouteNode in interface ActionRequestService

findPendingRootRequestsByDocIdAtOrBelowRouteLevel

public List<ActionRequestValue> findPendingRootRequestsByDocIdAtOrBelowRouteLevel(String documentId,
                                                                                  Integer routeLevel)
Specified by:
findPendingRootRequestsByDocIdAtOrBelowRouteLevel in interface ActionRequestService

findPendingRootRequestsByDocIdAtRouteLevel

public List<ActionRequestValue> findPendingRootRequestsByDocIdAtRouteLevel(String documentId,
                                                                           Integer routeLevel)
Specified by:
findPendingRootRequestsByDocIdAtRouteLevel in interface ActionRequestService

findPendingRootRequestsByDocumentType

public List<ActionRequestValue> findPendingRootRequestsByDocumentType(String documentTypeId)
Specified by:
findPendingRootRequestsByDocumentType in interface ActionRequestService

saveActionRequest

public void saveActionRequest(ActionRequestValue actionRequest)
Specified by:
saveActionRequest in interface ActionRequestService

findPendingByDoc

public List<ActionRequestValue> findPendingByDoc(String documentId)
Specified by:
findPendingByDoc in interface ActionRequestService

findPendingByDocRequestCdRouteLevel

public List<ActionRequestValue> findPendingByDocRequestCdRouteLevel(String documentId,
                                                                    String requestCode,
                                                                    Integer routeLevel)
Specified by:
findPendingByDocRequestCdRouteLevel in interface ActionRequestService

findPendingByDocRequestCdNodeName

public List<ActionRequestValue> findPendingByDocRequestCdNodeName(String documentId,
                                                                  String requestCode,
                                                                  String nodeName)
Specified by:
findPendingByDocRequestCdNodeName in interface ActionRequestService

findActivatedByGroup

public List findActivatedByGroup(String groupId)
Specified by:
findActivatedByGroup in interface ActionRequestService

getActionRequestDAO

public ActionRequestDAO getActionRequestDAO()

setActionRequestDAO

public void setActionRequestDAO(ActionRequestDAO actionRequestDAO)

findByStatusAndDocId

public List<ActionRequestValue> findByStatusAndDocId(String statusCd,
                                                     String documentId)
Specified by:
findByStatusAndDocId in interface ActionRequestService

alterActionRequested

public void alterActionRequested(List actionRequests,
                                 String actionRequestCd)
Specified by:
alterActionRequested in interface ActionRequestService

isDuplicateRequest

public boolean isDuplicateRequest(ActionRequestValue actionRequest)
Specified by:
isDuplicateRequest in interface ActionRequestService

findDelegator

public Recipient findDelegator(List actionRequests)
Description copied from interface: ActionRequestService
Returns the highest priority delegator in the list of action requests.

Specified by:
findDelegator in interface ActionRequestService

findDelegator

public Recipient findDelegator(ActionRequestValue actionRequest)
Description copied from interface: ActionRequestService
Returns the closest delegator for the given ActionRequest

Specified by:
findDelegator in interface ActionRequestService

findDelegatorRequest

public ActionRequestValue findDelegatorRequest(ActionRequestValue actionRequest)
Specified by:
findDelegatorRequest in interface ActionRequestService

deleteByDocumentId

public void deleteByDocumentId(String documentId)
Specified by:
deleteByDocumentId in interface ActionRequestService

deleteByActionRequestId

public void deleteByActionRequestId(String actionRequestId)
Specified by:
deleteByActionRequestId in interface ActionRequestService

validateActionRequest

public void validateActionRequest(ActionRequestValue actionRequest)
Specified by:
validateActionRequest in interface ActionRequestService

getDelegateRequests

public List getDelegateRequests(ActionRequestValue actionRequest)
Specified by:
getDelegateRequests in interface ActionRequestService

getTopLevelRequests

public List getTopLevelRequests(ActionRequestValue actionRequest)
Description copied from interface: ActionRequestService
If this is a role request, then this method returns a List of the action request for each recipient within the role. Otherwise, it will return a List with just the original action request.

Specified by:
getTopLevelRequests in interface ActionRequestService

isValidActionRequestCode

public boolean isValidActionRequestCode(String actionRequestCode)
Specified by:
isValidActionRequestCode in interface ActionRequestService

doesPrincipalHaveRequest

public boolean doesPrincipalHaveRequest(String principalId,
                                        String documentId)
Description copied from interface: ActionRequestService
Checks if the given user has any Action Requests on the given document.

Specified by:
doesPrincipalHaveRequest in interface ActionRequestService

getActionRequestForRole

public ActionRequestValue getActionRequestForRole(String actionTakenId)
Specified by:
getActionRequestForRole in interface ActionRequestService


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.