Event Listener module
Job module
Language module
Macro Module
Servlet Filter module
Servlet module
Theme module
Web UI modules
Workflow module

Trigger module

Available:

From Confluence 2.2 to Confluence 5.9

Changed:

In Confluence 3.5 and later, the trigger element accepts an optional child element (managed), which defines the scheduled job's availability in Confluence's administration console.

Status:Deprecated in Confluence 5.10, use Job Config instead

Using Trigger plugin modules you can schedule when your Job Module 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 a sample atlassian-plugin.xml fragment containing a Job with its corresponding Trigger module using a cron-style expression (for reference, this expression will execute the job with key 'myJob' every minute):

1
2
<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 * * * * ?" />     
        <managed editable="true" keepingHistory="true" canRunAdhoc="true" canDisable="true" />
    </trigger>
    ...
</atlassian-plugin>

The trigger element accepts the following attributes:

  • name – represents how this component will be referred to in the Confluence interface.
  • key – represents the internal system name for your Trigger.

The trigger element also accepts the following elements:

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

1
2
...
    <trigger key="myTrigger" name="My Trigger">
        <job key="myJob" />
        <schedule repeat-interval="3600000" repeat-count="5" />
     </trigger>    
...

Rate this page: