Job Scheduler: Scheduler Job Types

Scheduler configuration, jobs, queues, and troubleshooting

Scheduler Job Types

Overview

Each scheduler job method is stored in the table and is also classified by module and class.
Each method is listed below, grouped by module and class.
Find out more about a particular method by going to it's detailed page.

Class: queries** This class contains methods that allow you to run queries, or multiple queries grouped into scripts. They are useful if you want to send reports in a simple format via email, or to run regular update queries over your database. Where the Status is set to 'Active', and the 'Send Mail' check box is checked ON, a mail recipient must be added for the Job Item to be saved or created. In addition, where the status is 'Inactive', and the 'Send Mail' check box is checked ON, the 'Run Now' function (where available) will fail.

  • executeQuery) — This job type allows you to run a report in the form of an SQL query, and send the output as an email attachment. It is useful for sending regular reports both internally and externally. Using the Attachment Required checkbox, exception reports can be generated where an email is sent only if the report finds anything. See User Defined Queries for instructions on writing queries for the Job Scheduler.
  • executeScript) — Scripts are groups of queries that modify data but don't return anything. You can include as many SQL statements you like within a script. A script can include any number of UPDATE / INSERT / SET / LOCK TABLES / UNLOCK TABLES statements. There are many possible uses for these e.g. set the status to 'expired' for all quotes older than 30 days. User Defined Queries for instructions on writing scripts for the Job Scheduler.
  • mailQuery — Allows you to schedule bulk emails with report attachments to multiple clients or suppliers etc.
  • interfaceQuery — Allows you to extract data into a file with a User Defined Query and save it in your DMZ area. Once in your DMZ area you can access the file using utilities such as FTP. This can be used to create data interfaces from Catch-e to your external systems.
  • interfaceQueryIncremental — Allows you to generate an interface file in the DMZ area containing only records from either fmclients, fmsuppliers, or fm_contracts, that have changed since the last time this job was run. A User Defined Query is used to define the content of the output file.
  • eventQuery — Allows you to schedule the creation of Contract and Driver Events, that relate to the Event Types currently set up against both modules.
  • executeImportTableData — Allows you to import and update the tables using scheduler

System

Method:Synopsis
Class: system This class contains system level methods.
dmzMoveFileMove a file from one DMZ folder to another, or simply rename a file.
dmzUploadFileTransfer a file from your DMZ folder to an external site via SFTP.
dmzUploadSpoolTransfer all of the files stored in one of your DMZ folders to an external site via SFTP. The uploaded files are also archived.

System Maintenance

System maintenance jobs are normally scheduled on your behalf by Catch-e staff.

Method:Synopsis
checkSPFRecordForGbMailSenderDomains)This job type checks and validates the SPF record of any domains stored in the table.
deidentifyDriverDataAllows you to permanently delete or de-identify personal data (including audit records) from the tables using scheduler
rebuildDriverAllocations)This job type allows you to rebuild the fmcontractdriver_allocations table. You might want to run this after importing 'DRIVER' type contract events if you don't want to wait for the scheduled daily rebuild.
rebuildDivisionAllocations)This job type allows you to rebuild the fmcontractdivision_allocations table. You might want to run this after importing 'DIV' type contract events if you don't want to wait for the scheduled daily rebuild.
rebuildCostCentreAllocations)This job type allows you to rebuild the fmcontractcostcentreallocations table. You might want to run this after importing 'CC' type contract events if you don't want to wait for the scheduled daily rebuild.
updateMailDeliveryStatusFromPostfix)This job type moves all delivered or undelivered email\s information from Postfix database to its respective client database.

Glass

This class contains methods to interface with Redbook via their SFTP site.

Method:Synopsis
importVehicleDataImport Glasses vehicle data from Glasses SFTP server.

Red Book

This class contains methods to interface with Redbook via their FTP site.

Method:Overview
importVehicleData)Import vehicle data from the RedBook FTP server.
importVehiclePhotos)Import photos from the RedBook FTP server.

Approvals

Method:Synopsis
fm / approvals / autoPostClaimsThis job post claims if sufficient funds are available.

AutoGuru

Method:Synopsis
fm / autoguru / importApprovalsThis job imports a data file from Autoguru and posts approvals.

Billings

MethodDescriptionType
CombinedThis job runs scheduled Combined billings.fm / billings / combined
PeriodicThis job runs scheduled Periodic billings.fm / billings / periodic
RechargeThis job runs scheduled Recharge billings.fm / billings / recharges
Recharge FuelThis job runs scheduled Recharge Fuel billings.fm / billings / rechargesFuel

Card Services

Method:Synopsis
importTransactionsThis job imports and posts card service files (e.g. fuel transactions) by automating the steps defined in Card Transactions.

Contracts

Method:Synopsis
importEvents)This job imports Road Side Assistance call outs from Assist Australia and creates Contract Events against each vehicle.

Finance

Method:Synopsis
UpdateClientFinancierCreditUsedThis scheduler method updates the Clients / Financiers "Used" amount.
export255FinanceData)This job type creates an export file as detailed in the 255Finance interface.

This class contains methods to interface with the Onelink system.

Method:Synopsis
exportMaintHistoryIncremental. Each maintenance line id exported is stored in fmmaintenance1link table. See Technical Information 1Link Interface for full selection and exception details.
exportVehicleComplete export. See Technical Information 1Link Interface for full selection and exception details.
importInvoicesComplete export. See Technical Information 1Link Interface for full selection and exception details.

Payments

Method:Synopsis
PeriodicThis job runs scheduled Periodic payments.

MySalPack

Method:Synopsis
importPackagingData)This job imports MySalPack employee information and packaging transactions.

Swann

This class contains methods to interface to Swann Insurance's Activ8 system.

Method:Synopsis
exportProposals)This job type is an interface used to export Proposal Documents to Swann Insurance's SIS system.
importPolicies)This job type is an interface used to import Policy Documents from Swann Insurance's SIS system.
importVehicles)This job type is an interface used to import Swann's Vehicle Reference data into the fmswannvehicles table.

Approvals

Method:Synopsis
autoBuildClaimsThis job will create and post cost records for salary-packaged item.
sp / approvals / autoPostClaimsRun this job to post claims when the listed criteria are met. Contract Type Group = ‘Salary Packaged’ Contract is linked to an Item The Funds Check calculation shows there are sufficient funds available

Payments

| Method: | Synopsis |
| --- | --- | | autoPostPayments | This job will automatically post the next due Payment when the listed criteria are met. Contract Type Group = ‘Salary Packaged’ Contract is linked to an Item Contracts / Payments record “Due Date” meets the Dated To Method job criteria |

MYOB

This class contains methods to interface with MYOB.

Method:Synopsis
createExportBatch)Creates an MYOB export batch for the given Ledger Type (Sales/Purchases/Journals), equivalent to running the menu option Accounts / Export / MYOB / General Ledger / New - Create. The export batch file data is generated, and cached in the gb_exports table to greatly improve performance whenever the export file is generated. The export batch is saved with a status of 'pending'.
createExportFileCreates and emails an MYOB export file for the given Ledger Type (Sales/Purchases/Journals), for the most recent export batch that is at 'pending' status. It then sets the status to 'exported_ok'.

JDE

This class contains methods to interface with JDE.

Method:Synopsis
createExportBatch)Creates an JDE export batch for the given Ledger Type (Sales/Purchases/Journals), equivalent to running the menu option Accounts / Export / JDE / General Ledger / New - Create. The export batch file data is generated, and cached in the gb_exports table to greatly improve performance whenever the export file is generated. The export batch is saved with a status of 'pending'.
createExportFileCreates and emails an JDE export file for the given Ledger Type (Sales/Purchases/Journals), for the most recent export batch that is at 'pending' status. It then sets the status to 'exported_ok'.

Greentree

This class contains methods to interface with Greentree.

Method:Synopsis
createExportBatch)Creates an greentree export batch for the given Ledger Type (Sales/Purchases), equivalent to running the menu option Accounts / Export / Greentree / General Ledger / New - Create. The export batch file data is generated, and cached in the gb_exports table to greatly improve performance whenever the export file is generated. The export batch is saved with a status of 'pending'.
createExportFileCreates and emails an greentree export file for the given Ledger Type (Sales/Purchases), for the most recent export batch that is at 'pending' status. It then sets the status to 'exported_ok'.

Xero

This class contains methods to interface with Xero.

Method:Synopsis
createExportBatch)Creates an xero export batch for the given Ledger Type (Sales/Purchases/Journals), equivalent to running the menu option Accounts / Export / xero / General Ledger / New - Create. The export batch file data is generated, and cached in the gb_exports table to greatly improve performance whenever the export file is generated. The export batch is saved with a status of 'pending'.
createExportFileCreates and emails an xero export file for the given Ledger Type (Sales/Purchases/Journals), for the most recent export batch that is at 'pending' status. It then sets the status to 'exported_ok'.

Scheduler Setup

Send Mail Checkbox

  1. Use to set a preferred default for the job type. 'yes' if you expect an email to sent, or 'no' if an email is not useful
  2. If = 'no', this checkbox will be disabled and emails cannot be sent, regardless of how is set.

Creating Queries

User Defined Queries
Derived Fields
Encrypted Fields
Office(xls) Format_Format)
Office(xlsx) Format)

Table Details

The scheduler uses 4 tables to run:

gbschedulertypes

gbschedulertypes is maintained by catch-e support and contains the job definitions for web services available to be scheduled. The content is client specific.

Field definition:

FieldDescription
schedulertypeidUnique id
bespoke_flag'yes' indicates a client specific service
moduleModule to which this job is assigned, for example fm or gb
classClass where the method resides
methodWeb service to be executed
descriptionDefault job description, free text field
sendmailflag'yes' e-mails results to one or more recipients
attachmentrequiredflag'yes' only sends results e-mail if something is generated
mail_subectSubject field for results e-mail, free text
mail_messageBody of the results e-mail, free text
mailfooterflag'yes' appends the standard company mail footer
super_flag'yes' implies a system job, only visible by super users

gbschedulerjobs

gbschedulerjobs contains the web services scheduled for execution. These entries are partially derived from the gbjobtypes table and the source of the gbschedulerqueue table(below). The content includes all jobs ever listed for scheduled execution, but not the schedule itself. Schedule times can be specified as ranges (eg. 1-20), comma separated (eg. 1, 2, 3, …, 20) or a combination thereof (eg. 1, 2, 3-19, 20).
Field definition:

  • schedulerjobid — Unique id
  • schedulertypeid — Foreign key for gbjobtypes
  • schedulertypeid_parent — Job parent
  • description — Job description, free text
  • paramaters — Paramaters
  • minutes — 0-59, minute(s) in the hour to schedule the job
  • hours — 0-23, hour(s) in the day to schedule the job
  • days — 1-31, day(s) of the month to schedule the job. Use "EOM" if you want to run the job on last day of the month.
  • months — 1-12, month(s) of the year to schedule the job
  • weekdays — 0-7, day(s) of the week to schedule the job, 0 = Sunday
  • last_run — Date and time of last execution
  • created — Creation date and time
  • sendmailflag — 'yes' e-mails results to one or more recipients
  • attachmentrequiredflag — 'yes' will only send an e-mail if results are generated
  • record_type — Optional type of catch-e entity to attach results to
  • record_id — Optional unique id of catch-e entity to attach results to
  • useridsender — gb_users user id of results e-mail 'From' identity
  • mail_subect — Subject field for results e-mail, free text
  • mail_message — Body of the results e-mail, free text
  • mailfooterflag — 'yes' appends the standard company mail footer
  • recycling_flag — 'yes' will recycle the last 'completed' item in the scheduler queue unless: a) an error occurs (status would be 'error') b) an email is linked to the queue item c) 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)
  • useridlastedit — gbusers user id of the last person to edit the record
  • last_edit — Date and time of the last edit
  • reportableexecutiontime — By Default reportableexecutiontime should be 60seconds for all jobs , Newly created and copied job's reportable execution time should be 60seconds If the reportable execution time is increase more than 60seconds, A log should be generated in kibana , If the runtime is moved from outside business hours to within business hours ‘reportableexecutiontime’ will be reset to the default value or kept at the existing value whichever is lower.
  • status_flag — 'active' causes the job to be immediately scheduled

Frequently scheduled jobs should have the recyclingflag enabled, a single gbschedulerjobs record can generate over 40,000 gbscheduler_queue entries per month (31 days * 24 hours * 60 minutes).

gbschedulerqueue

gbschedulerqueue is the execution schedule for jobs from gbschedulerjobs. The content of this table is maintained by the job scheduler. The job scheduler checks entries in gbschedulerjobs for those requiring addition to gbschedulerqueue before executing required jobs listed in gbschedulerqueue.

Field definition:

FieldDescription
schedulerqueueidUnique id
schedulerjobidForeign key for gbschedulerjobs
scheduled_startDate and time to be executed
actual_startDate and time of execution
actual_endDate and time of completion
messageError or completion text returned by the web service
mailbatchnoMail batch that results e-mails were included in
recycle_flagIf 'no' this item cannot be recycled
status_flagIndicative of the state of this queue entry

Within a minute of an active gbschedulerjob record being created, the job scheduler will have created a gbschedulerqueue entry for this job. Setting the gbschedulerjob record to inactive will delete pending gbschedulerqueue entries.

gbschedulerjob_recipients

gbschedulerjobrecipients stores the details of people to be e-mailed when a job successfully completes or fails. There can be many recipients related back to a single gbscheduler_jobs entry.

Field definition:

FieldDescription
schedulerjobidForeign key for gbschedulerjobs
recipient_noSequenced counter of recipients for the given scheduled job
nameFree text, name of the e-mail recipient
addressE-mail address of the recipient
typeTo, Cc or Bcc
receipt_flag'yes' to return a receipt from job e-mail
receiveerrorsflag'yes' to receive job errors, 'no' to receive job results
status_flagIndicative of the status of this recipient