Running a Job

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. If you attempt to run a job, a warning message will be displayed if JobServer is not in "RUNNING" mode. In which case you may see a message like this: "Not able to run Job: Server Not Running". If you see this message, contact your JobServer administrator and have them start the JobServer scheduling and processing engine. You may access the control panel for starting and stopping JobServer's processing engine by accessing the JobServer "System Administration" tool from the JobServer Workbench page.

Queuing Priority

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. Note, that your job may not run immediately if there is no available capacity and may sit in the queue waiting its turn to run.

Properties Passed to the Job

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 fetched 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".

Passing Uploaded Files as Properties

Files can also be uploaded and passed to a job dynamically at runtime as properties. The files are passed to the JobContext of the running job and available for the Tasklet to fetch as a byte array with the given property name.

The built-in ShellScript Tasklet and SparkApp Tasklet have special capabilities that allow them to map properties entered here during the manual running of a job. The properties are passed to the ShellScript and SparkApp Taslet as shell environment variables. This gives the user running a job the ability to pass any set of properties and files to a job dynamically and exposed the as shell environment variables. In the case of an uploaded file, the file is copied to the job's runtime directory and mapped as an environment variable containing the absolute path and filename that the file that was copied to.

Send me email when job finishes running

Checking this box will tell JobServer to attempt to send you an email when the job has completed processing. You will also receive email notifications if any errors occur during processing. Note, that in order to receive these emails, your JobServer administrator must have properly configured the JobServer environment to connect with your email servers, otherwise you may not receive any emails. The emails will contain some basic status information on the job, along with a link back to the JobTracker tool so you can view a more detailed report on the run status of your job.

Note, that notification emails will be sent to the email address you have specified in your user profile. If you do not have an email address specified in your profile, no email will be sent. You may edit your user profile email address from the the "Edit Profile" app found on the JobServer Workbench page.