org.kuali.rice.kns.service.impl
Class PostProcessorServiceImpl

java.lang.Object
  extended by org.kuali.rice.kns.service.impl.PostProcessorServiceImpl
All Implemented Interfaces:
PostProcessorRemote, PostProcessorService

@Transactional
public class PostProcessorServiceImpl
extends Object
implements PostProcessorService

This class is the postProcessor for the Kuali application, and it is responsible for plumbing events up to documents using the built into the document methods for handling route status and other routing changes that take place asyncronously and potentially on a different server.


Field Summary
private  DateTimeService dateTimeService
           
private  DocumentService documentService
           
private static org.apache.log4j.Logger LOG
           
 
Constructor Summary
PostProcessorServiceImpl()
           
 
Method Summary
 boolean afterProcess(AfterProcessEventDTO event)
          This method first checks to see if the document can be retrieved by the DocumentService.
 boolean beforeProcess(BeforeProcessEventDTO event)
          This method first checks to see if the document can be retrieved by the DocumentService.
 boolean doActionTaken(ActionTakenEventDTO event)
          KEW is signaling that the document has had an action taken on it by a user
 boolean doDeleteRouteHeader(DeleteEventDTO event)
          KEW is signaling that the document should be deleted.
 boolean doRouteLevelChange(DocumentRouteLevelChangeDTO levelChangeEvent)
          The document has changed route level.
 boolean doRouteStatusChange(DocumentRouteStatusChangeDTO statusChangeEvent)
          The document has changed route status.
protected  void establishGlobalVariables()
          Establishes the UserSession if one does not already exist.
 Long[] getDocumentIdsToLock(DocumentLockingEventDTO event)
          This method first checks to see if the document can be retrieved by the DocumentService.
private  void logAndRethrow(String changeType, Exception e)
           
private  void logOptimisticDetails(int depth, Throwable t)
          Logs further details of OptimisticLockExceptions, using the given depth value to limit recursion Just In Case
 void setDateTimeService(DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 void setDocumentService(DocumentService documentService)
          Sets the documentService attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static org.apache.log4j.Logger LOG

documentService

private DocumentService documentService

dateTimeService

private DateTimeService dateTimeService
Constructor Detail

PostProcessorServiceImpl

public PostProcessorServiceImpl()
Method Detail

doRouteStatusChange

public boolean doRouteStatusChange(DocumentRouteStatusChangeDTO statusChangeEvent)
                            throws RemoteException
Description copied from interface: PostProcessorRemote
The document has changed route status. The docEvent contains the information about the change. This method should do what ever is appropriate for various route status changes to a document. The method should return true if the change is correct and all application actions as a result of the change are successful. It should return false if the application considers this an incorrect change. The method can throw a ResourceUnavailableException in order to requeue the document and try again later.

Specified by:
doRouteStatusChange in interface PostProcessorRemote
Returns:
true if the status change is correct and application actions are successful later if this exception is thrown
Throws:
RemoteException
See Also:
PostProcessorRemote.doRouteStatusChange(org.kuali.rice.kew.dto.DocumentRouteStatusChangeDTO)

doRouteLevelChange

public boolean doRouteLevelChange(DocumentRouteLevelChangeDTO levelChangeEvent)
                           throws RemoteException
Description copied from interface: PostProcessorRemote
The document has changed route level. The docEvent contains the information about the change. This method should do what ever is appropriate for various route level changes to a document. The method should return true if the change is correct and all application actions as a result of the change are successful. It should return false if the application considers this an incorrect change. The method can throw a ResourceUnavailableException in order to requeue the document and try again later.

Specified by:
doRouteLevelChange in interface PostProcessorRemote
Returns:
true if the status change is correct and application actions are successful
Throws:
RemoteException
See Also:
PostProcessorRemote.doRouteLevelChange(org.kuali.rice.kew.dto.DocumentRouteLevelChangeDTO)

doDeleteRouteHeader

public boolean doDeleteRouteHeader(DeleteEventDTO event)
                            throws RemoteException
Description copied from interface: PostProcessorRemote
KEW is signaling that the document should be deleted. The application can reject this by returning false. If an Exception is thrown the docuemnt will go to exception routing. If a ResourceUnavailableException is thrown, the doc will be requeued and will try again later to delete the document.

Specified by:
doDeleteRouteHeader in interface PostProcessorRemote
Returns:
Throws:
RemoteException
See Also:
PostProcessorRemote.doDeleteRouteHeader(org.kuali.rice.kew.dto.DeleteEventDTO)

doActionTaken

public boolean doActionTaken(ActionTakenEventDTO event)
                      throws RemoteException
Description copied from interface: PostProcessorRemote
KEW is signaling that the document has had an action taken on it by a user

Specified by:
doActionTaken in interface PostProcessorRemote
Returns:
Throws:
RemoteException
See Also:
PostProcessorRemote.doActionTaken(org.kuali.rice.kew.dto.ActionTakenEventDTO)

afterProcess

public boolean afterProcess(AfterProcessEventDTO event)
                     throws Exception
This method first checks to see if the document can be retrieved by the DocumentService. If the document is found the Document.afterWorkflowEngineProcess(boolean) method will be invoked on it

Specified by:
afterProcess in interface PostProcessorRemote
Parameters:
event - - holder for data from the engine's process including whether the engine was successful or not
Returns:
true if the method is successful, false otherwise
Throws:
Exception - A general Exception will put the document into Exception routing
See Also:
PostProcessorRemote.afterProcess(org.kuali.rice.kew.dto.AfterProcessEventDTO)

beforeProcess

public boolean beforeProcess(BeforeProcessEventDTO event)
                      throws Exception
This method first checks to see if the document can be retrieved by the DocumentService. If the document is found the Document.beforeWorkflowEngineProcess() method will be invoked on it

Specified by:
beforeProcess in interface PostProcessorRemote
Parameters:
event - - holder for data from the engine's process
Returns:
true if the method is successful, false otherwise
Throws:
Exception - A general Exception will put the document into Exception routing
See Also:
PostProcessorRemote.beforeProcess(org.kuali.rice.kew.dto.BeforeProcessEventDTO)

getDocumentIdsToLock

public Long[] getDocumentIdsToLock(DocumentLockingEventDTO event)
                            throws Exception
This method first checks to see if the document can be retrieved by the DocumentService. If the document is found the Document.beforeWorkflowEngineProcess() method will be invoked on it

Specified by:
getDocumentIdsToLock in interface PostProcessorRemote
Returns:
an array of document ids to lock prior to execution of the workflow engine
Throws:
Exception
See Also:
PostProcessorRemote.beforeProcess(org.kuali.rice.kew.dto.BeforeProcessEventDTO)

logAndRethrow

private void logAndRethrow(String changeType,
                           Exception e)
                    throws RuntimeException
Throws:
RuntimeException

logOptimisticDetails

private void logOptimisticDetails(int depth,
                                  Throwable t)
Logs further details of OptimisticLockExceptions, using the given depth value to limit recursion Just In Case

Parameters:
depth -
t -

setDocumentService

public final void setDocumentService(DocumentService documentService)
Sets the documentService attribute value.

Parameters:
documentService - The documentService to set.

setDateTimeService

public final void setDateTimeService(DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.

establishGlobalVariables

protected void establishGlobalVariables()
                                 throws WorkflowException
Establishes the UserSession if one does not already exist.

Throws:
WorkflowException


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.