Processors - Scheduler

Introduction

The Orbeon Forms Scheduler processor allows applications to start and stop periodic tasks. A task is defined by a processor and its inputs. You can start or stop a task at any time. The config input must conform to this Relax NG schema.

Starting a task

You start a task by invoking the Scheduler processor with the start-task element. The following table describes the configuration elements.

name The name of the task
start-time
  • now
  • XML xs:dateTime value:
    • E.g. 2006-06-10T16:20:12 or 2006-06-10T16:20:12.514
    • If no timezone is specified, the System's default timezone is used.
interval Interval between tasks in milliseconds. If set to 0, the task runs only once.
synchronized If set to true, the task won't run if the previous iteration is still running. Defaults to false.
processor-name The qualified name of the processor that is executed when the task runs.
input Inputs of the processor. The input can either be located in a separate file or inline.

In most cases, the task is described in an XPL pipeline. The following example shows how to use the Pipeline Processor to launch a periodic task.

<p:processor xmlns:p="http://www.orbeon.com/oxf/pipeline" name="oxf:scheduler">
<p:input name="config">
<config>
<start-task>
<name>myTask</name>
<start-time>now</start-time>
<interval>10000</interval>
<processor-name>oxf:pipeline</processor-name>
<input name="config" url="oxf:/mytask.xpl"/>
</start-task>
</config>
</p:input>
</p:processor>

Stopping a task

You can stop a task with the stop-task element and the name of the task.

<p:processor xmlns:p="http://www.orbeon.com/oxf/pipeline" name="oxf:scheduler">
<p:input name="config">
<config>
<stop-task>
<name>myTask</name>
</stop-task>
</config>
</p:input>
</p:processor>
Comments