org.kuali.kfs.sys.batch.service.impl
Class AutoDisapproveDocumentsServiceImpl

java.lang.Object
  extended by org.kuali.kfs.sys.batch.service.impl.AutoDisapproveDocumentsServiceImpl
All Implemented Interfaces:
AutoDisapproveDocumentsService

@Transactional
public class AutoDisapproveDocumentsServiceImpl
extends Object
implements AutoDisapproveDocumentsService

This class implements the AutoDisapproveDocumentsService batch job.


Field Summary
protected static org.apache.log4j.Logger LOG
           
static String WORKFLOW_DOCUMENT_HEADER_ID_SEARCH_RESULT_KEY
           
 
Constructor Summary
AutoDisapproveDocumentsServiceImpl()
          Constructs a AutoDisapproveDocumentsServiceImpl instance
 
Method Summary
protected  void autoDisapprovalYearEndDocument(org.kuali.rice.kns.document.Document document, String annotationForAutoDisapprovalDocument)
          autoDisapprovalYearEndDocument uses DocumentServiceImpl to mark as disapproved by calling DocumentServiceImpl's disapproveDocument method.
 boolean autoDisapproveDocumentsInEnrouteStatus()
          Gathers all documents that are in ENROUTE status and auto disapproves them.
protected  boolean canAutoDisapproveJobRun()
          This method will compare today's date to the system parameter for year end auto disapproval run date
protected  boolean checkIfAnnotationForDisapprovalParameterExists()
          This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_ANNOTATION
protected  boolean checkIfDocumentCompareCreateDateParameterExists()
          This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_DOCUMENT_CREATE_DATE
protected  boolean checkIfDocumentEligibleForAutoDispproval(org.kuali.rice.kns.document.Document document)
          This method will check the document's document type against the parent document type as specified in the system parameter
protected  boolean checkIfDocumentTypesExceptionParameterExists()
          This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_DOCUMENT_TYPES
protected  boolean checkIfParentDocumentTypeParameterExists()
          This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE
protected  boolean checkIfRunDateParameterExists()
          This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_DOCUMENTS_RUN_DATE
protected  boolean exceptionsToAutoDisapproveProcess(org.kuali.rice.kns.document.Document document, Date documentCompareDate)
          This method first checks the document's create date with system parameter date and then checks the document type name to the system parameter values and returns true if the type name exists
protected  org.kuali.rice.kns.document.Document findDocumentForAutoDisapproval(String documentHeaderId)
          This method finds the document for the given document header id
protected  ReportWriterService getAutoDisapproveErrorReportWriterService()
          Gets the autoDisapproveErrorReportWriterService attribute.
protected  org.kuali.rice.kns.service.DateTimeService getDateTimeService()
          Gets the dateTimeService attribute.
protected  Date getDocumentCompareDateParameter()
          This method finds the date in the system parameters that will be used to compare the create date.
 org.kuali.rice.kns.service.DocumentService getDocumentService()
          Gets the documentService attribute.
protected  org.kuali.rice.kew.doctype.service.DocumentTypeService getDocumentTypeService()
          Gets the documentTypeService attribute.
protected  org.kuali.rice.kns.service.NoteService getNoteService()
          Gets the NoteService, lazily initializing if necessary
protected  org.kuali.rice.kns.service.ParameterService getParameterService()
          Gets the parameterService attribute.
protected  org.kuali.rice.kim.service.PersonService<org.kuali.rice.kim.bo.Person> getPersonService()
           
protected  boolean processAutoDisapproveDocuments(String principalId, String annotation, Date documentCompareDate)
          This method will use documentsearchcriteriaDTO to search for the documents that are in enroute status and disapproves them
 void setAutoDisapproveErrorReportWriterService(ReportWriterService autoDisapproveErrorReportWriterService)
          Sets the autoDisapproveErrorReportWriterService attribute value.
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
          Sets the documentService attribute value.
 void setNoteService(org.kuali.rice.kns.service.NoteService noteService)
          Sets the noteService attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
protected  boolean systemParametersForAutoDisapproveDocumentsJobExist()
          This method checks if the System parameters have been set up for this batch job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG

WORKFLOW_DOCUMENT_HEADER_ID_SEARCH_RESULT_KEY

public static final String WORKFLOW_DOCUMENT_HEADER_ID_SEARCH_RESULT_KEY
See Also:
Constant Field Values
Constructor Detail

AutoDisapproveDocumentsServiceImpl

public AutoDisapproveDocumentsServiceImpl()
Constructs a AutoDisapproveDocumentsServiceImpl instance

Method Detail

autoDisapproveDocumentsInEnrouteStatus

public boolean autoDisapproveDocumentsInEnrouteStatus()
Gathers all documents that are in ENROUTE status and auto disapproves them.

Specified by:
autoDisapproveDocumentsInEnrouteStatus in interface AutoDisapproveDocumentsService
See Also:
org.kuali.kfs.sys.batch.service.autoDisapproveDocumentsInEnrouteStatus#autoDisapproveDocumentsInEnrouteStatus()

systemParametersForAutoDisapproveDocumentsJobExist

protected boolean systemParametersForAutoDisapproveDocumentsJobExist()
This method checks if the System parameters have been set up for this batch job.


checkIfRunDateParameterExists

protected boolean checkIfRunDateParameterExists()
This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_DOCUMENTS_RUN_DATE

Parameters:
outputErrorFile_ps - output error file stream to write any error messages.
Returns:
true if YEAR_END_AUTO_DISAPPROVE_DOCUMENTS_RUN_DATE exists else false

checkIfParentDocumentTypeParameterExists

protected boolean checkIfParentDocumentTypeParameterExists()
This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE

Parameters:
outputErrorFile_ps - output error file stream to write any error messages.
Returns:
true if YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE exists else false

checkIfDocumentCompareCreateDateParameterExists

protected boolean checkIfDocumentCompareCreateDateParameterExists()
This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_DOCUMENT_CREATE_DATE

Parameters:
outputErrorFile_ps - output error file stream to write any error messages.
Returns:
true if YEAR_END_AUTO_DISAPPROVE_DOCUMENT_CREATE_DATE exists else false

checkIfDocumentTypesExceptionParameterExists

protected boolean checkIfDocumentTypesExceptionParameterExists()
This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_DOCUMENT_TYPES

Parameters:
outputErrorFile_ps - output error file stream to write any error messages.
Returns:
true if YEAR_END_AUTO_DISAPPROVE_DOCUMENT_TYPES exists else false

checkIfAnnotationForDisapprovalParameterExists

protected boolean checkIfAnnotationForDisapprovalParameterExists()
This method checks for the system parameter for YEAR_END_AUTO_DISAPPROVE_ANNOTATION

Parameters:
outputErrorFile_ps - output error file stream to write any error messages.
Returns:
true if YEAR_END_AUTO_DISAPPROVE_ANNOTATION exists else false

canAutoDisapproveJobRun

protected boolean canAutoDisapproveJobRun()
This method will compare today's date to the system parameter for year end auto disapproval run date

Returns:
true if today's date equals to the system parameter run date

processAutoDisapproveDocuments

protected boolean processAutoDisapproveDocuments(String principalId,
                                                 String annotation,
                                                 Date documentCompareDate)
This method will use documentsearchcriteriaDTO to search for the documents that are in enroute status and disapproves them

Parameters:
principalId - The principal id which is KFS-SYS System user to run the process under.
annotation - The annotation to be set as note in the note of the document.
documentCompareDate - The document create date to compare to

checkIfDocumentEligibleForAutoDispproval

protected boolean checkIfDocumentEligibleForAutoDispproval(org.kuali.rice.kns.document.Document document)
This method will check the document's document type against the parent document type as specified in the system parameter

Parameters:
document -
Returns:
true if document type of the document is a child of the parent document.

getDocumentCompareDateParameter

protected Date getDocumentCompareDateParameter()
This method finds the date in the system parameters that will be used to compare the create date. It then adds 23 hours, 59 minutes and 59 seconds to the compare date.

Returns:
documentCompareDate returns YEAR_END_AUTO_DISAPPROVE_DOCUMENT_CREATE_DATE from the system parameter

findDocumentForAutoDisapproval

protected org.kuali.rice.kns.document.Document findDocumentForAutoDisapproval(String documentHeaderId)
This method finds the document for the given document header id

Parameters:
documentHeaderId -
Returns:
document The document in the workflow that matches the document header id.

exceptionsToAutoDisapproveProcess

protected boolean exceptionsToAutoDisapproveProcess(org.kuali.rice.kns.document.Document document,
                                                    Date documentCompareDate)
This method first checks the document's create date with system parameter date and then checks the document type name to the system parameter values and returns true if the type name exists

Parameters:
document - document to check for its document type, documentCompareDate the system parameter specified date to compare the current date to this date.
Returns:
true if document's create date is <= documentCompareDate and if document type is not in the system parameter document types that are set to disallow.

autoDisapprovalYearEndDocument

protected void autoDisapprovalYearEndDocument(org.kuali.rice.kns.document.Document document,
                                              String annotationForAutoDisapprovalDocument)
                                       throws Exception
autoDisapprovalYearEndDocument uses DocumentServiceImpl to mark as disapproved by calling DocumentServiceImpl's disapproveDocument method.

Parameters:
document - The document that needs to be auto disapproved in this process
annotationForAutoDisapprovalDocument - The annotationForAutoDisapprovalDocument that is set as annotations when canceling the edoc.
Throws:
Exception

setDocumentService

public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
Sets the documentService attribute value.

Parameters:
documentService - The documentService to set.

getDocumentService

public org.kuali.rice.kns.service.DocumentService getDocumentService()
Gets the documentService attribute.

Returns:
Returns the documentService.

getParameterService

protected org.kuali.rice.kns.service.ParameterService getParameterService()
Gets the parameterService attribute.

Returns:
Returns the parameterService.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value.

Parameters:
parameterService - The parameterService to set.

getDateTimeService

protected org.kuali.rice.kns.service.DateTimeService getDateTimeService()
Gets the dateTimeService attribute.

Returns:
Returns the dateTimeService.

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.

getNoteService

protected org.kuali.rice.kns.service.NoteService getNoteService()
Gets the NoteService, lazily initializing if necessary

Returns:
the NoteService

setNoteService

public void setNoteService(org.kuali.rice.kns.service.NoteService noteService)
Sets the noteService attribute value.

Parameters:
noteService - The noteService to set.

getPersonService

protected org.kuali.rice.kim.service.PersonService<org.kuali.rice.kim.bo.Person> getPersonService()
Returns:
Returns the personService.

getDocumentTypeService

protected org.kuali.rice.kew.doctype.service.DocumentTypeService getDocumentTypeService()
Gets the documentTypeService attribute.

Returns:
Returns the documentTypeService.

getAutoDisapproveErrorReportWriterService

protected ReportWriterService getAutoDisapproveErrorReportWriterService()
Gets the autoDisapproveErrorReportWriterService attribute.

Returns:
Returns the autoDisapproveErrorReportWriterService.

setAutoDisapproveErrorReportWriterService

public void setAutoDisapproveErrorReportWriterService(ReportWriterService autoDisapproveErrorReportWriterService)
Sets the autoDisapproveErrorReportWriterService attribute value.

Parameters:
autoDisapproveErrorReportWriterService - The autoDisapproveErrorReportWriterService to set.


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