Typically, a job is run by the Scheduling Engine when a job's next run date has
been reached. Sometimes, however, a user may have the need to run a job
manually outside the normal scheduling rules.
A user can do this by selecting a job and clicking
the "Manually Run Job" button. This will immediately kick off the job.
Note, that you can also specify an effective date range
when running the job. The effective date ranges are passed to the JobContext and can be referenced
from JobContext.getStartDateRange()
and JobContext.getEndDateRange()
.
Jobs can only be run when the JobServer environment is in "Running" mode. A warning message will be displayed if JobServer is not in "Running" mode.
When manually running a job, the job will get queued with the priority value as defined in Job Designer. A user can, optionally, set a different priority on the fly when the job is manually run.
When running a job, you have the option of passing properties that can be accessed from JobContext found in
soafaces.bunndle.workflow.JobContext
. The properties you pass
the job here can be fetch programmatically from the Tasklet, when the job runs,
using the getAttributes()
method from JobContext. You
can use these properties to customize the behavior of the job when it is manually run. You can pass
five types of attributes which include String, Integer, Long, Boolean, java.util.Date,
and DateTime (represented as java.util.Date and allows setting date and time). DateTime is represented
with a 24 hour clock so for example March 1st 2007 at 11:00PM would be
represented by "2007-03-01 23:00:00".