Setting up triggers

A trigger defines the event that causes the task to run, for example either reaching a specified date and time or when the modification date on a file changes.

Before you begin

You must create a task before you can set up any triggers.

About this task

You can trigger tasks in three ways:

  • Trigger when file changes runs a task whenever a specified file is updated (or created if the file is copied to a directory before the import or export). The file does not have to be associated with any import specification.

    The Scheduler service checks the modification or creation date on the file at the interval that is set for the service. It runs the scheduled task when the modification date for the file is later than the start date set in the trigger.

  • Trigger by date/time runs a task to import or export data after an interval of time.

    The service will calculate the interval from the details in the trigger, and run the scheduled task when the calculated date and time is reached.

  • Run runs the selected task the next time the service runs. For details, see Setting up batch import and export tasks.

With the exception of Run triggers, triggers last indefinitely unless you set an end date. Triggers that have passed their end date remain on the system and can be reactivated when needed.

The following date and time options are available:

Option

When the task is scheduled to run

Daily

After the specified number of days. For example, enter 10 to run a batch import every 10 days.

Weekly

After the specified number of weeks, on the required days of the week.

Monthly

After the specified number of months, on the required day of the month. (Note: A task that is scheduled to run on day 29, 30, or 31 will always run on the last day of the month if there are fewer than 29, 30 or 31 days in the month.)

Once

Only on the run date, at the selected time.

Every

Every n minutes or hours, on the run date, between the specified times.

Each time the Scheduler service runs, it calculates the next scheduled task for any active triggers it finds that do not have a schedule. The run date is shown in the log if the logging option When tasks are scheduled to run is selected. The time that a task runs is always approximate.

If for some reason there is a delay, such as pausing the service, then the service will attempt to run it later when the service resumes. The next scheduled task will not be added to the queue, or shown in the log file, until the current scheduled task has completed.

The first run date depends on the start date and time in the active trigger, but all dates are inclusive:

Start date

Effect on scheduling

Today's date

The task will run today. If it is set to run at a time in the past, then the task runs immediately unless the Ending at time is also passed.

Past date, future date

This date is used to calculate the next run date only, at the time(s) specified in the trigger.

When you edit a trigger, the service recalculates the run date of the next task to be scheduled for the active trigger, and marks the current scheduled task as updated (in the log description).

Procedure

  1. Click New below the list of triggers to display the Trigger dialog.

  2. Enter a descriptive name for the trigger, such as Every Monday Night, Alternate Weeks (until Jun 2005). The maximum length of the name is 255 characters.

  3. If you do not want to schedule the task at this stage turn off the Active checkbox.

  4. In Start date, enter the date that iBase Scheduler will use as the starting point when calculating the intervals between scheduled tasks. You can choose a past or future date if required. Selecting a past date and/or time will affect how the next task is scheduled; for details, see How tasks are triggered above.

  5. Triggers are active until further notice. To turn off this feature, click End date and enter the end date.

For example, if you enter the 5th May then the last possible date on which the task can run is the 5th. Triggers that reach their end date can be re-used by editing them.

  1. Choose the event that makes the task run. To trigger the task to run:

  2. When the modification date on a file changes, select Trigger when file changes, and then enter the path to the file or browse for it. The file does not have to exist at this stage.

  3. When a date and time is reached, select Trigger by date/time and then enter the number of days, weeks or months, and an optional time.

See Types of trigger above for details.

  1. Click OK to save the trigger.

The first task scheduled for this trigger will appear in the log the next time the Scheduler service runs (provided that the logging option When tasks are scheduled to run is selected).