Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Orders for job chains can be assigned calendars that specify the date for which an order should be executed, see JOC Cockpit - Calendar Management.
  • Frequently such job chains are executed on a specific date, but should carry a business date parameter - handed over to scripts and executables - that specifies e.g. the previous day.
  • In this situation the execution date is different from the business date and suggests some more complex scenarios:
    • The business date might be specific for a calendar, let's assume Mon-Fri considering non-working days of a stock exchange in some country.
    • The execution date could be specific for a company calendar in a different country that includes to execute jobs Mon-Thu excluding non-working days in that country or company.
    •  Therefore the order for a business date targeted for some Fri would be executed next Mon. Should this Mon meet a non-working day then the execution could be postponed to next Tue. As a result we face a non-deterministic number of days between the business date and the execution date.
  • JobScheduler handles execution dates well, but does not know the distinction from a business date for which some job chain is executed. This article proposes a solution to this gap.

...

Solution Outline

  • Basically two calendars have to be used
    • a calendar for business dates that are used to parameterize orders for job chains.
    • a calendar for execution dates on which job chains are started.
  • The solution includes to
    • create a standalone job that creates an order for a job chain. The job runs on business dates and will carry a create an order parameter for this date. 
    • create a job chain that is specified to run on execution dates, i.e. is based on its own calendar.
  • As a consequence the following scenarios are covered;
    • two orders for two business dates Thu and Fri are created. If Thu and Fri do not meet execution dates in the company calendar then both orders will wait in the target job chain to be executed e.g. next Mon, each order carrying its individual business date parameter.
    • if one of the scheduled orders fails then this does not prevent other orders for other business dates from being executed.

...

  • The below sample implementation is available for download: business_dates.zip
  • Unzip the sample to your JobScheduler Master's live folder. This will create a business_date sub-folder with the below job-related objedtsobjects.

Standalone Job to create Orders for Business Dates

...

  • The above examples are created without use of calendars in order to be compatible with JobScheduler releases before 1.12. Howevev, if you operate a more recent JobScheduler release then we encourage you to use e Calendars that use Calendars from the JOC Cockpit that are much more flexible than start-time rules.
  • The above example is not specific for a single job chain. Starting from the assumption that the standalone job run_for_business_date and the job chain carry the same name and are located in the same folder you can create copies of the standalone job to run for any job chain. The assumption of the standalone job is that the execution date should follow the business date (current date) by 24 hours.

...