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>    
...

Since this plugin is only available for confluence 2.2 and later, when is the version 2.2 available for download? Thanks

Posted by vincent.chen at Apr 17, 2006 11:45

Now.

Posted by rmiranda@informationofficer.com at May 05, 2006 10:41

Does this plugin work in Confluence 2.2.1a? It worked in version 2.2. After we upgraded to 2.2.1a, my job didnot get triggered. Can someone giveme a idea?

Posted by vincent.chen at May 27, 2006 23:35

Hi Vincent,
the plugging in subject has been tested and it works fine with Confluence version 2.2 xxx
You may like to re-check whether your trigger element is configured correctly.
If you still believe that there is a problem, you may raise a request support here [1].
Please be sure to attach a zip archive of your logs directory <INSTALL>logs
Also you may like to attach your plugin xml file for us to review.

Thanks,
Ivan
 

[1] http://confluence.atlassian.com/display/Support/Creating+a+Support+Issue

Posted by ivan@atlassian.com at May 29, 2006 21:09
Document generated by Confluence on Mar 22, 2007 21:00