View Javadoc
1   /*
2    * Copyright 2007 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.fp.batch;
17  
18  import java.util.Date;
19  
20  import org.kuali.ole.fp.batch.service.ProcurementCardCreateDocumentService;
21  import org.kuali.ole.sys.batch.AbstractStep;
22  
23  /**
24   * This step will call a service method to route pcdo documents that are in 'I' status.
25   */
26  public class ProcurementCardRouteDocumentsStep extends AbstractStep {
27      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ProcurementCardRouteDocumentsStep.class);
28      private ProcurementCardCreateDocumentService procurementCardDocumentService;
29  
30      /**
31       * @see org.kuali.ole.sys.batch.Step#execute(java.lang.String, java.util.Date)
32       */
33      public boolean execute(String jobName, Date jobRunDate) {
34          // TODO: put a temporary delay in here to workaround locking exception happening with Pcard approve and indexing
35          try {
36              Thread.sleep(300000);
37          }
38          catch (InterruptedException e) {
39              throw new RuntimeException(e);
40          }
41  
42          return procurementCardDocumentService.routeProcurementCardDocuments();
43      }
44  
45      /**
46       * @param procurementCardDocumentService The procurementCardDocumentService to set.
47       */
48      public void setProcurementCardCreateDocumentService(ProcurementCardCreateDocumentService procurementCardDocumentService) {
49          this.procurementCardDocumentService = procurementCardDocumentService;
50      }
51  }