This page last changed on Jan 17, 2007 by jnolen.
Trigger plugin modules are available in Confluence 2.2 and later.

Trigger plugin modules enable you to schedule when your Job Plugins are scheduled to run Confluence.

Trigger Plugin Module

The Trigger plugin module schedules Jobs within a plugin. Triggers are one of two types:

  • cron - jobs are scheduled using cron syntax
  • simple - jobs are scheduled to repeat every X seconds

Here is an example atlassian-plugin.xml fragment containing a Job with it's corresponding Trigger module using a cron-style expression (for reference, this expression will execute the job with key 'myJob' every minute):

<atlassian-plugin name="Sample Component" key="confluence.extra.component">
    ...
    <job key="myJob"
          name="My Job"
          class="com.example.myplugin.jobs.MyJob" />
    <trigger key="myTrigger" name="My Trigger">       
        <job key="myJob" />       
        <schedule cron-expression="0 * * * * ?" />     
    </trigger>
    ...
</atlassian-plugin>

For the <trigger> element:

  • the name attribute represents how this component will be referred to in the Confluence interface.
  • the key attribute represents the internal, system name for your Trigger.
  • the class attribute represents the class of the Job to be created. The class must have a no-argument constructor, or it will not be able to be instantiated by Confluence.

For more details on the cron expressions, see the Quartz documentation for CronTrigger.

Here is another example, this time using a simple trigger that repeats every 360000 seconds (1 hour) and will only repeat 5 times:

...
    <trigger key="myTrigger" name="My Trigger">
        <job key="myJob" />
        <schedule repeat-interval="360000" repeat-count="5" />
     </trigger>    
...
Document generated by Confluence on Dec 20, 2007 19:02