The configuration file of a Scheduled plug-in is named 'schedule.config.xml' and consists of the following structure:
- General information is specified between the
- Generic settings are specified between the
- Specific settings are specified between the
<?xml version="1.0" encoding="UTF-8"?> <plugin> <info> </info> <schedule> </schedule> <config> </config> </plugin>
This article describes the generic settings.
For information about the general information settings and the specific plug-in settings, see Elvis 6 plug-in configuration files.
The Generic schedule settings
The generic schedule settings control when the plug-in should be executed.
<schedule> <active>false</active> <triggers> <!-- Fire every 5 minutes --> <cronTrigger>0 0/1 * * * ?</cronTrigger> </triggers> <runAgainWhenJobHasMoreWork>true</runAgainWhenJobHasMoreWork> <allowParallelExecution>false</allowParallelExecution> </schedule>
The settings can be divided into basic settings and advanced settings.
- active (Required) Controls whether the schedule should be active or not. Possible values:
- true. (Default) Makes the triggers (see below) active.
- false. Disables the triggers, Executing the plug-in can still be done manually through the plug-ins page of the Management Console.
- triggers (Optional) One or multiple cronTrigger tags which define how the plug-in is scheduled. The cron trigger format is based on Unix cron with the addition of the seconds field. It has the following format:
Seconds Minutes Hours Day-of-month Month Day-of-week [Year]
Note: Elvis Server uses quartz as its scheduling engine. For details, see the Cron Trigger Tutorial on quartz-scheduler.org.
Tip: To simplify the creation of your own cron trigger, use a tool such as CRON tester.
Note: Make sure to add a leading zero (for the seconds) in front of your created Unix cron expression before you put it in the Elvis cronTrigger. Unix cron expressions produced by this tool are missing the seconds field.
Note: The advanced settings are in most cases correctly defined by the plug-in developer; changing them could cause the plug-in to malfunction.
- runAgainWhenJobHasMoreWork (Optional) Controls if the plug-in only runs once or if it runs again if it has more work. Possible values:
- true (default) Run the plug-in again if it has more work.
- false. Run the plug-in only when it is scheduled.
Note: A plug-in can notify the scheduler that it has more work by creating an empty file without any extension in its 'plugin' folder with the name: has-more-work.
- allowParallelExecution (Optional) Controls if the plug-in will be executed in parallel or not. Possible values:
- true. Execute the plug-in in parallel when a trigger fires while the plug-in is already running.
- false (default) Do not execute the plug-in in parallel; any trigger that is fired while the plug-in is running is delayed.