Job Scheduler: Job

Scheduler configuration, jobs, queues, and troubleshooting

Job

This is where you create and edit scheduled jobs. There are many different Job Types that you are able to run.

Service

  • Status (Drop List) — New jobs default to 'active' by default and will run automatically when a stored Run Time is reached. Set jobs to 'inactive' if you don't want to run them anymore, or if you want to run the job on an 'ad-hoc' basis using the Run Now button. When you update a job to become 'inactive', check to see if there are any child jobs. When a parent job is made 'inactive', child jobs are made 'inactive' at the same time. Making a parent job active again will not update any children. They must be made 'active' again individually.
  • Parent Job ID (Num) — Enter or lookup a job that you want to add as the parent. Visit the Parent Job ID page for all the details feature details.
  • Module (List) — Select the relevant module.
  • Class (List) — Class category from gbschedulertypes
  • Method (List) — Select the method that should be used in the job.
  • Description (Text) — Enter a description of the job.
  • Parameters (Heading) — Different fields will display in the Parameters section depending on which "Method" you have chosen. Visit the Method page to find and read about the requirements for your chosen "Method".
  • Attachment Format (List box) — Choose the required format for the attachment file from 'Office(xlsx))', 'Office(xls)'_Format), 'Text (csv)', 'Text (txt)' or 'XML'. 'Office(xlsx))' is the default value.

Mail

  • Send Mail (Check Box) — Check this on if you want to send an email when the job runs. Each scheduler method has a default setting for this check box. See the set-up page fore more details. For some methods, it is disabled when emailing is not applicable. If the job's method is executeQuery), the email is sent to the stored recipients and they receive the executed query as an attachment in the email. For other methods, the purpose of "Send Mail" is to email the recipients to confirm that the job has run. This includes mailQuery jobs. Use "Send Mail" if you want to receive a confirmation that the mailQuery job ran, the mailQuery email content itself is not visible on this screen. If this field is checked, the job won't save unless; a "Sender" is recorded the job status is 'Active' there is at least one "Recipient" entered If this field is un-checked, The "Subject" field is disabled The "Sender" record is removed
  • Subject (Text) — Enter the Subject line to display in sent emails. NOTE: the placeholder #SERVERNAME# can used and will be replaced by the value from the environment variable SERVERNAME at run time
  • Body (Text) — Enter the text to display in the body of sent emails when the "Send Mail" field is checked. When it's unchecked, this field can be used to store comments
  • Use Standard Footer (Checkbox) — Tick the Checkbox ON to incorporate the mail footor stored in

Errors

  • Type, Name, Address, Receipt Flag — Enter the details of where error messages should be sent

Run Times

| Minute, hour, day, month and weekday are multi-select boxes, hold down the Ctrl key to select multiple values. | | | The schedule times take some getting used to. The combination allows the scheduling of re-occurring execution for any minute of any day of the year. For example, to execute a job at the end of the financial year, you would select 0 minute, 12am hour, 1st day, Jul month and All weekdays. New jobs do not have any run times set by default and must be set before saving. Jobs should generally not be set up to run every minute where possible. Users will be alerted with a pop up message if they have selected the run times to every minute. If a Parent Job ID entered, Run Times cannot be edited and will use the Parent Job Run Time parameters. | | [Warning:] | Whilst it is possible to set run times to run a job every minute it is not recommended. Doing so may impair the system response times and slow down users work. It is recommended that if a job is run on a frequent basis, set as a minimum time to run on 15 minutes intervals and limit to possibly working days as an example.
| Minute | Checkbox, List | Minute(s) of the hour to schedule this job | |
| Hour | Checkbox, List | Hour(s) of the day to schedule this job | |
| Day | Checkbox, List | Day(s) of the month to schedule this job. Choose 'EOM' if you would like the job to run on the last day of each month. | |
| Month | Checkbox, List | Month(s) of the year to schedule this job | |
| Weekday | Checkbox, List | Weekday(s) of the week to schedule this job | |
| Sender | Lookup | If an email is going to be sent when the job is run, select the user to show as the email sender. If you use the Run Now button, you will be shown as the email sender, and not the stored "Sender". If you are running mailQuery jobs, the sender is defined in the query, those emails do not use the stored "Sender". We recommend using (or creating then using) a user called 'Scheduler' for all jobs (except those that need the "Sender" to be a particular person from your business). This means that your staff will know that the email came from a scheduler job, not an actual person. | |
| Linked To | | Attach job results to this type of catch-e object | |
| Record ID | | Attach job results to the catch-e object identified by this id | |
| Report Queue | | Check this to store the generated reports in the Report Queue. Recipients can be advised of the report, but will not receive it in the email. This is only available when the selected "Method" is executeQuery). The check box is disabled for all other methods. | |
| Recipients | | gbschedulerjob_recipients to receive job results. A recipient must be added where the status is 'Active' and the 'Send Mail' check box is ON | |
| Attachment Required | | When checked, recipients will only receive an email if running the job generated an email attachment. If no file generates when the job runs, the email is not sent. This is checked by default for new jobs and can be un-checked. | |
| Queue | | | |
| Next Due | Timestamp | Displays the date and time of the next scheduled run for this job. If you edit the job, this will show as unavailable for a couple of minutes until the job queue is refreshed with the new next run record. | where = 'pending' |
| Recycling | Check box | If this check box is un-checked, all past job records are retained and can be viewed on the Scheduler / Queue tab. If checked, past records that are completed correctly are discarded and are no longer visible on the Scheduler / Queue tab except for the following; Any job queue records linked to a Mail Batch The last 10 successful job queue records where no email has been sent Any job queue records that failed Any job queue records that aborted Any job queue records where the service asked the scheduler not to recycle the queue item in its response (e.g. an interface service found and imported a file, item is to be kept for reporting purposes e.g. SLA) | |

Top Buttons

  • — Create a new job based on the current job
  • — Create a new job

Bottom Buttons

  • — Edit an existing job [Run Now] Click to run the job manually. Run Now is available for selected job methods only and requires an entry in gbserviceprocess_types. Refer to the Validations and Alerts Run Now section for issues you may see here. Run Now can run a chain of parent-child jobs, or you can opt to run just the selected job from within the chain. Refer to the Validations and Alerts Run Now - Job Chain section for the various selections.

Edit Buttons

  • — When editing, click to cancel any changes you have made.
  • — When editing, click to save changes you have made to the current job.

Field Entry

  • Selecting "Send Mail" will disabled "Report Queue" and remove all linked recipients. Do you want to continue? OK Cancel — A confirmation alert that is displayed when "Send Mail" is checked and "Report Queue" had been checked. Only one of these check boxes can be selected.
  • Unselecting "Report Queue" will remove all linked recipients. Do you want to continue? OK Cancel — A confirmation alert that is displayed when "Report Queue" is un-checked.

Save

  • Address is invalid. OK Cancel — There is no populated Recipients: "Address". Enter an email address.
  • Child jobs are active: {job_id} These will be made inactive. Continue saving? OK Cancel — If you want the child jobs to become inactive also, continue to save. Otherwise, cancel the editing you are doing and update each child job and separate them from the parent if they should continue to run. Visit the Parent Job ID page for all the details feature details.
  • Mail sender is required. OK Cancel — Select a "Sender" for this email.

Run Now

  • Failed to run! Error: this process is still running! — The job is taking a long time to run. It will continue to run in the background until completion.
  • Failed to run! Error: A recipient is required. — If you have clicked on Run Now and "Send Mail" is checked, you must have a valid recipient recorded in the job. Job failed! Error: CATCH-E ERROR DUPLICATE COLUMN NAMES Error message: Duplicate column names The query has a duplicate column. Ask Catch-e Support to review and correct the query. The duplicate column will need to be removed or re-named. Job failed! Error: CATCH-E BAD QUERY The query is mal-formed in some way. Ask Catch-e Support to review and correct the query. Job failed! Error: CATCHEAPIEXECUTESCRIPT_ERROR Error message: Failure executing query #. Message: Statement could not be executed (45000 - 1644 - Billing already locked!) The executeScript) job started, but could not be completed. A billing lock could not be secured for one of the scripts in the query. The script number is shown in the message. Try again later.
  • Run Now - Job Chain Job has active children. Run child jobs also? The job is a parent, or is part of a chain of parent-child jobs. Click OK to run the job and it's children. To run just the selected job, click Cancel → 'Just run this job?' Click OK. Click Cancel to exit the process without running any jobs.
  • Failed to run! Cannot run this job because child job '{job_id}' must have at lease one recipient. — Go to the named job and add a recipient to it.
  • Failed to run! Cannot run this job because child job '{job_id}' is aborted. — You are trying to run a chain of jobs, but there is a job with an 'Aborted' status in the chain. Go to the Schedule tab and review the job chain. Review and fix any children that are 'Aborted' or 'Inactive'.
  • Failed to run! Cannot run this job because it is within a chain and is inactive. Either remove it from the chain or make it active. — Go to the Schedule tab and review the job chain and update the jobs as required to either make them active, or separate them from the chain.

Troubleshooting

Tip: Visit the main Troubleshooting page for a list of all the available problem-solving tips.

My Attachment Formatting did not work

If your scheduler job is using 'Office(xlsx))' as the "Mail Attachment", you cannot use a customisedFormat#customised-spreadsheet-formats) format.Go to the Scheduler / Job and change the output format to be 'Office(xls)'Format) if you want to create and use a customised_Format#customised-spreadsheet-formats) format.

Job Troubleshooting

My Attachment Formatting did not work

If your scheduler job is using 'Office(xlsx))' as the "Mail Attachment", you cannot use a customisedFormat#customised-spreadsheet-formats) format.Go to the Scheduler / Job and change the output format to be 'Office(xls)'Format) if you want to create and use a customised_Format#customised-spreadsheet-formats) format.

Parent Job

The Scheduler / Job "Parent Job ID" field allows you to link the job to another as a 'child'. Child jobs run automatically after the parent job each time it completes successfully.

Run time parameters are not set in child jobs, this is determined by the parent.

Any job may be a parent or a child or both. Multiple jobs can be linked in this way.

To review linked jobs;

  1. Go to Scheduler / Schedule
  2. Enter the parent job id into the "Job ID" field
  3. Check on the “Show all Children” check box
  4. The parent job and it's children will display on the screen
  5. If the children are also parents, their children will also be displayed (and so on)
  6. The jobs will display in cascade order (Parent, Children, Grandchildren, Great Grandchildren)

Setting a Parent Job to 'Inactive'

When a parent job is made 'inactive', child jobs are made 'inactive' at the same time.

You will be alerted if this is going to happen.

Continue with the process if making the child jobs 'inactive' is appropriate for the situation.

When you make a parent job active again, the child jobs do not update automatically. I.e. they will remain 'inactive'.

You will need to edit each child and update their "Status" to 'active' again individually.

If you do not want the child jobs to become inactive, you will need to edit them and remove the "Parent Job ID" link.

The child will retain the run time parameters the were held by the parent job.

These can now be edited if required.

Queue

The queue screen displays entries from gbschedulerqueue.
It contains many entries for the majority of scheduled jobs listed in
gbschedulerjobs. Filters are applied when the go button is clicked
and all filters (except Job Queue ID) combine to provide the minimum results.

Filters

FilterTypeDescription
Job IDLookupLocate gbschedulerqueue entries of gbschedulerjobs_id type
Queue IDLookupLocate a specific gbschedulerqueue entry
ModuleDrop ListModule category from gbschedulertypes
ClassDrop ListClass category from gbschedulertypes
MethodDrop ListWeb service to execute
Slow JobsCheck boxDisplays jobs that ran for more than 30 seconds
StatusDrop ListFilter by gbschedulerqueue status_flag

Columns

The column headers of this screen are dynamically sortable. By selecting the grey box header, the data will be sorted in an ascending order. If selected again, the data will be sorted in a descending order.

  • Job ID (Number) — System generated unique id
  • Queue ID (Number) — System generated unique id
  • Type (Text) — Module, class and method for the given schedulertypeid
  • Scheduled Start (Date) — Scheduled start date and time
  • Actual Start (Date) — Actual start date and time
  • Actual End (Date) — Actual end date and time
  • Duration (Time) — Actual end - actual start
  • Message (Text) — Displays the message that was generated when the job ran. These mostly describe job failures or the reasons why a completed job did not generate a report or update as expected. Go to the Message page for a list of messages and explanatory comments.
  • Status (Text) — The status is 'Completed' if the job ran successfully and 'Failed' if it did not complete for some reason.

Report Queue

The Scheduler / Job "Report Queue" check box allows you to send attachments directly to System / Report Queue.
"Report Queue" is only available for the executeQuery) method.

Behaviour of field Report Queue

When "Report Queue" is selected, the "Recipients" section updates to show the appropriate fields for this function. If "Report Queue" is un-checked, the "Recipients" section will show the standard emailing fields.

When "Report Queue" is selected, it will not display "Type" and "Receipt Flag" fields. Instead, it will display "User" and "Notify" fields.

When a user is selected, their "Notify" check box will default to show the setting stored in their System / Users "Report Queue Notifications" checkbox. This can be updated if required.

When "Notify" is un-checked, the user will not be notified when the report is ready.

When "Notify" is checked,, user will receive an email when the job has run and the report is ready.

When "Report Queue" is checked the fields below are shown on the scheduler.

Recipients: Recipient box when ‘Report Queue’ is selected

  • User (List) — Only users that has access to ‘Report Queue’ screen will be shown in the lookup and can be selected. This can be identified from for each role
  • Name (Text) — Name of the user
  • Address (Text) — Email address of the user
  • Notify (Check box) — When ‘Notify’ is unticked, user will not be notified when report is ready for them in ‘Report Queue’ screen. If ‘Notify’ checkbox is ticked, user will be notified when job has run, and report is ready for them in ‘Report Queue’ screen.

When the 'report queue' is checked off the below fields are available on the scheduler

Field Descriptions

Field NameTypeDescription
Report Queue
Recipients: Recipient box when ‘Report Queue’ is not selected
ToText
NameTextName of the user
AddressTextEmail address of the user
Receipt FlagCheck box

‘Attachment Required’ field when ‘Report Queue’ field is ticked:

  1. If ‘Attachment Required’ is untick and ‘Notify’ is tick, then user will be notified as soon as report has run even if there is no attachment. In Report Queue screen, it will show the report with no attachment.

  2. If ‘Attachment Required’ is tick and ‘Notify’ is tick, then user will be notified only when there is an attachment.

Please refer to the below follow chart to get more details about the Report Queue workflow:-