1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.batch;
17
18 import org.kuali.ole.module.purap.document.service.PaymentRequestService;
19 import org.kuali.ole.sys.batch.AbstractStep;
20 import org.kuali.ole.sys.context.SpringContext;
21 import org.kuali.rice.core.api.datetime.DateTimeService;
22
23 import java.util.Date;
24
25
26
27
28 public class AutoApprovePaymentRequestsStep extends AbstractStep {
29 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AutoApprovePaymentRequestsStep.class);
30
31 private PaymentRequestService paymentRequestService;
32
33 public AutoApprovePaymentRequestsStep() {
34 super();
35 }
36
37
38
39
40
41
42 public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
43 return paymentRequestService.autoApprovePaymentRequests();
44 }
45
46
47
48
49
50
51
52 public boolean execute() throws InterruptedException {
53 try {
54 return execute(null, SpringContext.getBean(DateTimeService.class).getCurrentDate());
55 } catch (InterruptedException e) {
56 LOG.error("Exception occured executing step", e);
57 throw e;
58 } catch (RuntimeException e) {
59 LOG.error("Exception occured executing step", e);
60 throw e;
61 }
62 }
63
64 public void setPaymentRequestService(PaymentRequestService paymentRequestService) {
65 this.paymentRequestService = paymentRequestService;
66 }
67
68 }