Elvis 5 Schedule plug-ins - configuration
Configuration settings for a schedule plug-in are defined in the schedule.config.xml file, which contains general plug-in information (A), generic schedule settings (B) and plug-in specific settings (C).
<?xml version="1.0" encoding="UTF-8"?> <plugin> <info> (A) </info> <schedule> (B) </schedule> <config> (C) </config> </plugin>
plug-in specific settings are documented for each individual plug-in, 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 plug-in manually.
- (2) 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 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 plug-in developer, changing them could cause the plug-in to malfunction.
- (3) runAgainWhenJobHasMoreWork - optional. Control if the plug-in just runs once or if it will run again if it has more work.
- true (default) - run the plug-in again if it has more work.
- false - run the plug-in once each time it is scheduled.
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
- (4) allowParallelExecution - optional. Control if the plug-in will be executed in parallel or not.
- true - execute the plug-in in parallel when a trigger fires while the plug-in is already running.
- false (default) - don't execute the plug-in in parallel, this causes any trigger fired while the plug-in is running to be delayed.