1 /*
2 * Copyright 2006 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.sys.batch;
17
18 import org.kuali.ole.sys.batch.service.AutoDisapproveDocumentsService;
19 import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
20
21 /**
22 * Runs the batch job that gathers all documents that are in ENROUTE status and cancels them.
23 */
24 public class AutoDisapproveDocumentsStep extends AbstractWrappedBatchStep {
25 private AutoDisapproveDocumentsService autoDisapproveDocumentsService;
26 protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AutoDisapproveDocumentsStep.class);
27 private String batchFileDirectoryName;
28 /**
29 * Overridden to run the auto disapprove process.
30 * @see org.kuali.ole.batch.Step#execute(java.lang.String)
31 */
32 @Override
33 protected CustomBatchExecutor getCustomBatchExecutor() {
34 return new CustomBatchExecutor() {
35 public boolean execute() {
36 boolean success = true;
37 success = autoDisapproveDocumentsService.autoDisapproveDocumentsInEnrouteStatus();
38
39 return success;
40 }
41 };
42 }
43
44 /**
45 * Sets the autoDisapproveEDocsService attribute value.
46 *
47 * @param autoDisapproveEDocsService The autoDisapproveEDocsService to set.
48 * @see org.kuali.ole.sys.service.AutoDisapproveEDocsService
49 */
50 public void setAutoDisapproveDocumentsService(AutoDisapproveDocumentsService autoDisapproveDocumentsService) {
51 this.autoDisapproveDocumentsService = autoDisapproveDocumentsService;
52 }
53
54 /**
55 * This method sets the batchFileDirectoryName
56 * @param batchFileDirectoryName
57 */
58 public void setBatchFileDirectoryName(String batchFileDirectoryName) {
59 this.batchFileDirectoryName = batchFileDirectoryName;
60 }
61 }