Project

General

Profile

Scheduler

FWD implements a cron-like scheduler, which can run FWD batch processes, start appserver agents or execute arbitrary Java classes or methods. For a general understanding of this facility, see Scheduling Tasks.

The scheduler is configured in the scheduler container, which resides as a child of the server/<server-id> or the server/default nodes.

The scheduler node has a list of child nodes of class job. For each job node, the node's name represents the job name (which must be unique across all jobs). Also, node-attribute nodes can be provided, with the following names:

  • type, mandatory, case insensitive: string representation of the job type, which can be PROCESS, CLASS, or METHOD.
  • target, mandatory: the job target, which can be:
    • in case of PROCESS, is the subject ID of a FWD process.
    • in case of CLASS, is the qualified name of a Java class which implements the java.lang.Runnable interface
    • in case of METHOD, is the qualified name of a Java class followed by the name of a no-arguments method, i.e. foo.bar.Something.execute
  • enabled, mandatory: boolean value flag indicating if this job is enabled.
  • mode, mandatory: string representation of the job mode, which can be:
    • NOW - for jobs being executed immediately
    • ONE_TIME - for jobs being executed at a certain time/date, a single time.
    • RECURRING - for recurring jobs executed at a certain time/date.
  • the target time, for RECURRING and ONE_TIME jobs (these follow the generic cron job specification):
    • minute: the scheduled minute, can be * or a value from 0 to 59.
    • hour: the scheduled hour, can be * or a value from 0 to 23.
    • day-of-month: the scheduled day of the month, can be * or a value from 1 to 31.
    • month: the scheduled month, can be * or a value from 1 to 12.
    • day-of-week: the scheduled day of the week, can be * or a value from 0 (Sunday) to 6 (Saturday).

For more details on the syntax of these elements, see the documentation provided by the org.quartz.CronExpression class javadoc (or in this saved version: quartz_job_scheduler_2.2.2_cronexpression_class_javadoc_20220217.pdf).

An example of a job starting an appserver at server startup to launch the appserver:

 <node class="container" name="scheduler">
     <node class="job" name="start_appserver">
       <node-attribute name="type" value="process"/>
       <node-attribute name="target" value="appserver-name"/>
       <node-attribute name="enabled" value="TRUE"/>
       <node-attribute name="mode" value="now"/>
     </node>
   </node>

© 2004-2022 Golden Code Development Corporation. ALL RIGHTS RESERVED.