View Javadoc
1   /*
2    * Copyright 2007-2009 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.gl.batch;
17  
18  import org.kuali.ole.gl.batch.service.BalancingService;
19  import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
20  import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
21  
22  /**
23   * Generates a balancing report if data is present in the history tables. Instructions on how to test this process for General Ledger:<br>
24   * 1) Place an acceptable GL_SORTPOST.data / GL_POSTERRS.data into batchFileDirectoryName (see spring-gl.xml)<br>
25   * 2) Run BatchStepRunner for posterEntriesStep<br>
26   * 3) Run BatchStepRunner for fileRenameStep<br>
27   * 4) Run BatchStepRunner for posterBalancingStep<br>
28   * 5) Evaluate GL batch directory for results
29   */
30  public class PosterBalancingStep extends AbstractWrappedBatchStep {
31      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(PosterBalancingStep.class);
32      
33      private BalancingService balancingService;
34      
35      /**
36       * @see org.kuali.ole.sys.batch.AbstractWrappedBatchStep#getCustomBatchExecutor()
37       */
38      @Override
39      protected CustomBatchExecutor getCustomBatchExecutor() {
40          return new CustomBatchExecutor() {
41              public boolean execute() {
42                  balancingService.runBalancing();
43                  return true;
44              }
45          };
46      }
47  
48      /**
49       * Sets the BalancingService
50       * 
51       * @param balancingService The BalancingService to set.
52       */
53      public void setBalancingService(BalancingService balancingService) {
54          this.balancingService = balancingService;
55      }
56  }