Commit 204aa0d2 by nilu

notification batch setup

parent 166b3e6a
package performa.batch;
import java.util.Calendar;
import oneit.appservices.batch.ORMBatch;
import oneit.logging.LogLevel;
import oneit.logging.LogMgr;
import oneit.logging.LoggingArea;
import oneit.objstore.ObjectTransaction;
import oneit.objstore.StorageException;
import oneit.objstore.rdbms.filters.InFilter;
import oneit.objstore.rdbms.filters.LessThanEqualFilter;
import oneit.utils.DateDiff;
import oneit.utils.parsers.FieldException;
import performa.orm.Job;
import performa.orm.types.JobStatus;
public class NotificationBatch extends ORMBatch
{
public static LoggingArea NOTIFICATION_BATCH = LoggingArea.createLoggingArea("NotificationBatch");
@Override
public void run(ObjectTransaction ot) throws StorageException, FieldException
{
LogMgr.log (NOTIFICATION_BATCH, LogLevel.PROCESSING1, "RUNNING Notification Batch");
Job[] closedJobs = Job.SearchByAll()
.andJobStatus(new InFilter<>(JobStatus.COMPLETE, JobStatus.FILLED))
.andLastStatusChangeDate(new LessThanEqualFilter<>(DateDiff.add(DateDiff.getToday(), 14, Calendar.DATE)))
.search(ot);
}
}
\ No newline at end of file
...@@ -165,6 +165,19 @@ ...@@ -165,6 +165,19 @@
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa"> <TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa">
<RUN class="performa.batch.NotificationBatch" factory="Participant"/>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
<NODE name="schedule" class="oneit.appservices.batch.DailySchedule">
<NODE name="hourOfDay" factory="Integer" value="0"/>
<NODE name="minuteOfHour" factory="Integer" value="10"/>
</NODE>
</WHEN>
</TASK>
<TASK factory="Participant" class="oneit.appservices.batch.DefaultTask" lockName="performa">
<RUN class="performa.batch.PullStripeDataBatch" factory="Participant"/> <RUN class="performa.batch.PullStripeDataBatch" factory="Participant"/>
<WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch"> <WHEN factory="MetaComponent" component="BatchSchedule" selector="performa.runbatch">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment