Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2013 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.kuali.rice.kew.impl.document;
 import java.util.List;
A service which effectively "refreshes" and requeues a document. It first deletes any pending action requests on the documents and then requeues the document for standard routing. Addionally, it adds duplicate notification suppression state to RouteNodeInstanceS for which ActionRequestS will be regenerated.

Intended to be called async and wired that way in server/client spring beans.

Kuali Rice Team (
 public class DocumentRefreshQueueImpl implements DocumentRefreshQueue {
 	private RouteHelper helper = new RouteHelper();
Requeues a document, and sets notification suppression data

 	public void refreshDocument(String documentId) {
 		if (StringUtils.isBlank(documentId)) {
             throw new RiceIllegalArgumentException("documentId is null or blank");
         PerformanceLogger performanceLogger = new PerformanceLogger();
         Collection<RouteNodeInstanceactiveNodes = getRouteNodeService().getActiveNodeInstances(documentId);
         List<ActionRequestValuerequestsToDelete = new ArrayList<ActionRequestValue>();
 		NotificationSuppression notificationSuppression = new NotificationSuppression();
         for (RouteNodeInstance nodeInstance : activeNodes) {
             // only "requeue" if we're dealing with a request activation node
             if (.isRequestActivationNode(nodeInstance.getRouteNode())) {
             	List<ActionRequestValuedeletesForThisNode = 
             	for (ActionRequestValue deleteForThisNode : deletesForThisNode) {
             		// only delete the request if it was generated by a route module (or the rules system)
             		if (deleteForThisNode.isRouteModuleRequest()) {
             			// suppress duplicate notifications
                 // this will trigger a regeneration of requests
         for (ActionRequestValue requestToDelete : requestsToDelete) {
         try {
             OrchestrationConfig config = new OrchestrationConfig(.);
         } catch (Exception e) {
         	throw new WorkflowRuntimeException(e);
         performanceLogger.log("Time to run DocumentRequeuer for document " + documentId);	
        return KEWServiceLocator.getActionRequestService();
        return KEWServiceLocator.getRouteNodeService();
New to GrepCode? Check out our FAQ X