How To Run Batch Jobs Manually

Run batch jobs using the BatchJobRunner

The BatchJobRunner can be used to run all or individual batch jobs.

To run all Batch Jobs

Add the parameter and value 'runAllBatchJobs', 'true' to the URL of the BatchJobRunner like so:

http://localhost:8083/mifos/runBatchJobs.ftl?runAllBatchJobs=true

To run a single batch job, say, 'ApplyHolidayChangesTask', use the following pattern:

http://localhost:8083/mifos/runBatchJobs.ftl?job=ApplyHolidayChangesTask

Run batch jobs on startup

This patch can be applied to allow batch jobs to run on application startup

!run-batch-jobs-on-startup.patch

To edit this file, look for "How To Run Batch Jobs On Startup" via a graphical WebDAV client, or /developers/wiki/run-batch-jobs-on-startup.patch via a command-line WebDAV client. I don't know why.

Related discussion: http://thread.gmane.org/gmane.comp.finance.mifos.user/160/focus=171

JSP hack to run one or more batch jobs immediately

Save the following as CATALINA_HOME/webapps/mifos/run.jsp, then fetch http://localhost:8080/mifos/run.jsp .

<%@page import="org.mifos.framework.components.batchjobs.*"%>
<%@page import="org.mifos.framework.components.batchjobs.helpers.*"%>
<%
class SimpleJob extends Thread {
    public void run() {
        MifosTask t = new GenerateMeetingsForCustomerAndSavingsTask();
        t.name = t.getClass().getName();
        t.run();
    }
}
new SimpleJob().start();
%>
Started batch job.

When using the Eclipse WTP, the JSP page should be placed in application/target/mifos-webapp in the Mifos source tree.