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.
TriggersThe 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.
- 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 intervalThe 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.
Task actionsBefore 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.