Scheduling

JReport Server provides a scheduling system which you can customize to suit your requirements. You can submit a scheduled task from web page and URL or by calling the Server API methods. However, before you can do this, you must first specify the report, catalog, task type and its launch type. In addition, you can also customize notification messages to notify others of whether or not the task is executed successfully.

User Task

In order to provide the means to run tasks defined outside of JReport on JReport Server, and to just use JReport Server's schedule function, JReport provides a task named User Task. With this task, you can implement a customized task with the schedule properties. Also, you can submit the user task from a web page, or by calling JReport Server API methods.

After creating a class that implements the UserTask interface in the jet.server.api package and adding the class to the class path, you can then submit the task either from a server web page or by calling Server API methods. The task can then be run by the server at the scheduled times just as if it were a report.

Trigger

The scheduling mechanism supports trigger conditions in addition to time conditions. Triggers are managed by name in JReport Server, so each trigger must have a unique name. After creating a trigger, you can submit a task that is bound with the trigger, and then fire the trigger to activate the task at anytime.

Trigger conditions are based on event driven modes. The server does not care whether a customized condition is ready. It only waits there for trigger firing events. Therefore, you determine whether the condition is ready before firing a trigger.

Triggers can also work together with time conditions for activating a scheduled task.

Related topics: