Elvis 4 Schedule plug-ins - configuration
Configuration settings for a schedule plugin are defined in the schedule.config.xml file, which contains general plugin information (A), generic schedule settings (B) and plugin specific settings (C).
<?xml version="1.0" encoding="UTF-8"?> <plugin> <info> (A) </info> <schedule> (B) </schedule> <config> (C) </config> </plugin>
Plugin specific settings are documented for each individual plugin, this article discusses the generic schedule settings.
Generic schedule settings (B)
<schedule> (1) <active>true or false</active> (2) <triggers> <cronTrigger>0 0/5 * * * ?</cronTrigger> <cronTrigger>0 0 23 * * ?</cronTrigger> </triggers> (3) <runAgainWhenJobHasMoreWork>true or false</runAgainWhenJobHasMoreWork> (4) <allowParallelExecution>true or false</allowParallelExecution> </schedule>
- (1) active - required. Main switch to control activation of the schedule.
- true (default) - make the triggers (2) active.
- false - disable the triggers, it's still possible to execute the plugin manually.
- (2) triggers - optional. One or multiple cronTrigger tags which define how the plugin is scheduled. The cron trigger format is based on Unix cron with the addition of the seconds field. It has the follwing format:
Seconds Minutes Hours Day-of-month Month Day-of-week [Year]
For details, see the quartz documentation, quartz is the scheduling engine used by Elvis. To simplify creation of your own cron trigger, you can use the following tools:
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 these tools are missing the seconds field.
<!-- Fire at 23pm every day --> <cronTrigger>0 0 23 * * ?</cronTrigger> <!-- Fire every 15 minutes --> <cronTrigger>schedule2 = 0 0/15 * * * ?</cronTrigger> <!-- Fire every 5 minutes --> <cronTrigger>schedule3 = 0 0/5 * * * ?</cronTrigger> <!-- Fire every 5 minutes at 2 past, 7 past, etc... --> <cronTrigger>schedule4 = 0 2/5 * * * ?</cronTrigger> <!-- Fire every minute --> <cronTrigger>schedule5 = 0 * * * * ?</cronTrigger> <!-- Fire every 2 hours between 8 AM and 8 PM on business days --> <cronTrigger>schedule5 = 0 0 8,10,12,14,16,18,20 * * 1,2,3,4,5</cronTrigger>
The advanced settings are in most cases already correctly defined by the plugin developer, changing them could cause the plugin to malfunction.
- (3) runAgainWhenJobHasMoreWork - optional. Control if the plugin just runs once or if it will run again if it has more work.
- true (default) - run the plugin again if it has more work.
- false - run the plugin once each time it is scheduled.
A plugin 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
- (4) allowParallelExecution - optional. Control if the plugin will be executed in parallel or not.
- true - execute the plugin in parallel when a trigger fires while the plugin is already running.
- false (default) - don't execute the plugin in parallel, this causes any trigger fired while the plugin is running to be delayed.