How Scheduler works

You can use iBase Scheduler to control the automatic import and export of data for a database. You can set up tasks to import or export when file changes are detected, or at set intervals.

Triggers

The Scheduler Service uses triggers to activate a task within an iBase database. A trigger can be configured to either monitor a file for changes, or to wait for a specific date and time before the task is activated.
For each trigger, an activation date and optionally a deactivation date can be specified:
File change triggers
File change triggers are a useful means of completing a task on an ad hoc basis, or for near real-time database updates. For example, if an iBase database is to be kept up-to-date with data from another system, but it is not known the precise time the export files from the other system are created, it might be possible for the other system to create or touch a triggering file after the export is completed.

Scheduler can be configured by using file change triggers to monitor the triggering file for a change in the modification date. After a change is detected in the modification date, Scheduler will start the task to import the data contained in the import files, or export data from another database.

Interval triggers
Interval triggers are useful for completing a task regularly, for instance, once a day, on particular days of the week, or on a specific day in the month. The trigger can instruct the task to run at a specific time in the day, or at regular intervals within a time window, with a minimum interval of a minute.
Note: The time window cannot span midnight. To do this, two triggers must be configured, one running from the start time up to midnight, the other running from midnight to the end time.

Service interval

The Scheduler Service is configured to run at regular intervals using the Run schedule service every option in the configuration utility. This service checks to see if tasks are available that need to be run, and can be configured to run as frequently as once per second. The maximum value that can be specified for the service interval is 9999 minutes.

When the schedule service is running, additional checks are not made, and extra tasks will not be triggered. Checks will only resume when the tasks complete or are stopped.

For example, if the service interval is set to 5 minutes, the trigger defines an execution frequency of 5 minutes. The task takes a minute to run, then the interval between executions of the task would be a minimum of 6 minutes.

Note: The service interval should be set to monitor triggers more frequently than the smallest interval trigger that is defined. Setting the service interval to a value that is greater than the smallest interval, causes the Scheduler Service to miss one or more expected schedules. For example, a trigger that is configured to run a task every fifteen minutes with a service interval of twenty-five minutes will run only three in every five schedules. However, having a service interval that is less than fifteen minutes will not necessarily solve this problem if the time taken to run the tasks extends the service interval to a value greater than the task frequency.

Task actions

Before a task is run and after the successful completion of a task, it is possible to complete one or more actions. These actions can take the form of an operating system command, a batch file, or a custom plug in written in a high-level language that supports COM interfaces.
  • Program actions

    Program actions can be a single operating system command, a batch file, or an executable program. These can be used to complete a simple data clean on a source file to remove unwanted records, data formatting to ensure that dates are in the correct format ready for import, or sending a notification message to a user by using the NET SEND command.

  • Plug-in actions

    Plug-in actions are written for customers in C# or another .Net language. Plug-ins can be used to manipulate the contents of the database or complete a custom action that is not easily completed through a program action, for instance sending an email message.

    A plug-in action must adhere to the following rules:
    • It must provide a means of accepting a reference to an iBase database.
    • It must provide a means of accepting a reference to the Scheduler log.
    • The processing must be completed inside a single entry point.

    To ensure that the developer of a plug-in provides the three preceding functions on its object interface, the Scheduler Framework includes an interface definition for use by plug-ins.