Index Changes

Difference between version and version     

Back to Scheduler SE, or Scheduler SE Info


At line 1 changed 328 lines.
%%tabbedSection
%%tab-About
The Scheduler Service Engine (SE), powered by [OpenSymphony Quartz|http://www.opensymphony.com/quartz/], affords scheduling capability to kick off (consume) other JBI component providers, for example a BPEL Service Engine.\\
Schedules are specified by creating a Scheduler project and subsequently a Schedule XML file containing one or more triggers that determine when to send the user specified message to the appropriate provider endpoint; the latter is configured via the Composite Application Service Assembly (CASA) editor.\\
When the Scheduler project is built, appropriate Web Service Definition Language (WSDL) files and a Service Unit Descriptor file (__{{jbi.xml}}__) are generated that can be used, for example, to define the respective Partner Links in a BPEL that's to be triggered by the Scheduler.\\
Lastly, the Scheduler project and other relevant projects (for example, BPEL project) are added into a Composite Application project, where the various Scheduler consumer endpoints can be connected to their respective ''to-be-triggered'' provider endpoints.
%%
%%tab-Features
!! Current (Release 1.0)
* The Scheduler SE currently only supports statically defined schedules (that is, via Schedule files contained in a Scheduler project).
* Quartz [SimpleTrigger|http://www.opensymphony.com/quartz/api/org/quartz/SimpleTrigger.html] (for example, do something every 30 seconds) is supported.
!! Planned
* Quartz [CronTrigger|http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html] (a la Unix crontab) will be supported soon.
* Dynamically defined and persisted schedules. In other words, a consumer endpoint can send a new schedule request to the Scheduler SE provider endpoint and at the appointed time, the respective trigger message will be sent back to same endpoint but of course, now in a provider role.
%%
%%tab-Inside
!! Architecture
Most of us have used schedulers like Mozilla Lightning or MS Outlook and are familiar with creating appointments whereby we can specify together the time when to perform a certain task as well as the task itself. To provide scheduling service in the JBI world, the definition of a trigger or time to send a message, in other words consume a service provider, is first declared in a Schedule file under a Scheduler project and then the actual connection of the trigger consumer endpoint to the intended task or service provider endpoint is done later in the CASA (Composite Application Service Assembly) editor. When the service assembly is deployed, messages specified during the trigger definitions and at the appointed times will be routed via the NMR (Normalized Message Router) to the waiting provider endpoints that will process the messages and execute the appropriate tasks.
The Scheduler SE is powered by OpenSymphony Quartz API and as such, the latter requires each trigger defined to belong to a unique group. Typically, a NetBeans project name is fairly unique and so the Scheduler project name is used as the Quartz group name. Moreover, this group name appended by the Schedule file name and the suffix __{{Port}}__ form the consumer endpoint name for all the triggers contained in the Schedule file. Thus, one Schedule file can only be used to trigger one task or provider endpoint, albeit at multiple times represented by the one or more triggers contained within.
!! Source Code
* Scheduler runtime code can be found here: [https://open-jbi-components.dev.java.net/source/browse/open-jbi-components/ojc-core/schedulerse/]
* Scheduler Project NetBeans Plugin here: [http://hg.netbeans.org/soa-dev/file/06bf5fb91836/scheduler.ui/]
!! Issue Tracker
* Goto [OpenESB Issue Tracker|https://open-esb.dev.java.net/IssueTracker.html]
* Login
* Select component: __{{open-jbi-components}}__
* and subcomponent: __{{Scheduler SE}}__
%%
%%tab-UserGuide
!! Steps
These instructions will illustrate how to trigger JBI components (service providers) using a Scheduler project. It is assumed that the reader is familiar with the JBI paradigm and in particular, how to design a BPEL project to implement and invoke specific web services.
;__Step 1__:Go to __{{File | New Project... | SOA (category) | Scheduler Module (project)}}__
[{Image src='SchedulerSE/NewProjectWiz.png' align='center' }]
;__Step 2__:Key in Project name. The name forms the first half of the Scheduler consumer endpoint name so choose one that's meaningful yet succinct (no spaces or other unsavory characters for now), for example schedules related to a particular demo, such as __{{SchedulerDemo}}__.
[{Image src='SchedulerSE/NameLocStepWiz.png' align='center' }]
;__Step 3__:Right-click the project's __{{Process Files}}__ folder and choose __{{New | Schedule File...}}__
[{Image src='SchedulerSE/NewSchedFile.png' align='center' }]
;__Step 4__:Key in Schedule file name. The name forms the latter half of the Scheduler consumer endpoint name so again, choose one that's meaningful yet succinct (no spaces or other unsavory characters for now), for example what this particular schedule will trigger, such as __{{KickOffBPEL}}__ (don't prvoide any extensions in the name for a standard __{{.sched}}__ extension is always used).
[{Image src='SchedulerSE/NewSchedFileWiz.png' align='center' }]
;__Step 5__:In the ensuing Schedule editor, click the __{{Add Simple Trigger}}__ toolbar button and a new trigger row will appear in the table below.
[{Image src='SchedulerSE/SchedTableEditorAdd.png' align='center' }]
;__Step 6__:With the respective trigger table row highlighted (note, the __{{Selected}}__ checkbox is used for indicating triggers selected for deletion), you can specify the various parameters for that trigger. Changes to a field are registered when either focus is lost or an __{{Enter}}__ key is pressed (except for the __{{Message}}__ text area since it will accept newlines as part of the data).
*** The __{{Starting}}__ and __{{Ending Date & Time}}__ entries delineate when this trigger will be active. Until a date/time chooser is implemented (very soon; or please donate if you have a good free open-source one), you'll need to enter one manually in the default locale format (Java [SimpleDateFormat|http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html] is used); the first item in the __{{Job Date Format}}__ exemplifies the default locale format. Alternatively, if you want the trigger to be active immediately after the Composite Application has been deployed, choose __{{Now}}__ and similarly select __{{Never}}__ if the active period has no end.
*** A simple trigger basically repeats after a certain time interval so specify the __{{Repeat Count}}__ or __{{Indefinite}}__ and the various time units that comprise the overall time interval.
*** Finally, the __{{Job}}__ section pertains to the __{{Message}}__ that will be sent when the trigger fires and will contain a metadata part that details the appointed date and time the trigger was configured to fire (note, this may precede the actual time the message is received due to network latency) in the specified __{{Date Format}}__. Moreover, the metadata will also contain the trigger's name and group to which it belongs.
[{Image src='SchedulerSE/SchedTableEditorPopulate.png' align='center' }]
;__Step 7__:Save your work and build the Scheduler project.
;__Step 8__:Use the generated WSDL files as appropriate to set up the provider endpoints to be triggered.
[{Image src='SchedulerSE/GeneratedWSDLs.png' align='center' }]
;__Step 9__:Create a JBI project that provisions the desired endpoints to be triggered, for example in the following BPEL project.
[{Image src='SchedulerSE/SampleBPELProject.png' align='center' }]
[{Image src='SchedulerSE/SampleBPELMapper.png' align='center' }]
;__Step 10__:Add this Scheduler project and other required ones into a Composite Application project.
;__Step 11__:Connect the various Scheduler consumer endpoints with their respective provider endpoints to be triggered.
[{Image src='SchedulerSE/SchedBPELCompApp.png' align='center' }]
;__Step 12__:Save Composite Application project, build, and deploy into running instance of GlassFish Application Server.
!! Schedule XML File Syntax
Here's what a typical one looks like:
{{{
<?xml version="1.0" encoding="UTF-8"?>
<schedule name="kickOffBPEL" group="SchedulerDemo"
xmlns="http://schemas.sun.com/jbi/engines/scheduler"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sun.com/jbi/engines/scheduler schedule.xsd">
<trigger name="everyMinute" enabled="true" description="Triggering the BPEL usecase every minute">
<simpleTrigger>
<starting>
<date value="now"/>
</starting>
<ending>
<date value="9/30/08 11:59 PM"/>
</ending>
<repeat count="indefinite">
<interval minutes="1"/>
</repeat>
</simpleTrigger>
<message date-format="M/d/yy h:mm a">Send status to loan applicant!</message>
</trigger>
</schedule>
}}}
!! Formal XML Schema Description
{{{
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://schemas.sun.com/jbi/engines/scheduler"
xmlns:sched="http://schemas.sun.com/jbi/engines/scheduler"
elementFormDefault="qualified">
<xsd:complexType name="scheduleType">
<xsd:sequence>
<xsd:element ref="sched:trigger" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Defines a Quartz trigger belonging to the group specified in the schedule element.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>Name for the set of triggers in this schedule. Note, this name forms the latter half of the prefix for the resultant Scheduler SE Consumer Endpoint name.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="group" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>Group name for the set of triggers in this schedule. Note, this name forms the first half of the prefix for the resultant Scheduler SE Consumer Endpoint name.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="description" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>Optional description for this schedule.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="triggerType">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="sched:simpleTrigger" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines a Quartz Simple Trigger that is interval-based (http://www.opensymphony.com/quartz/api/org/quartz/SimpleTrigger.html).</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
<xsd:element ref="sched:message" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines the message that will be sent to the respective service provider endpoint that is to be triggered.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>Name of the Quartz trigger and must be unique within the group.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="enabled" type="xsd:boolean" default="true" use="optional">
<xsd:annotation>
<xsd:documentation>If enabled, the Quartz trigger will be activated at runtime.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="description" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>Optional description for this trigger.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="simpleTriggerType">
<xsd:sequence>
<xsd:element ref="sched:starting" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines the date when this trigger will start operating.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="sched:ending" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines the date when this trigger will end operating.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element ref="sched:repeat" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines how often the trigger will be repeated.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="startingType">
<xsd:sequence>
<xsd:element ref="sched:date" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines the starting date.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="dateType">
<xsd:sequence/>
<xsd:attribute name="format" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>Format of date value being specified (per http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html) If not specified, format defaults to locale's default pattern.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="value" type="xsd:string" use="required">
<xsd:annotation>
<xsd:documentation>value can be "now" or "never" (case-insensitive and of course, format is ignored accordingly) or value corresponding to specified format.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="endingType">
<xsd:sequence>
<xsd:element ref="sched:date" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines the ending date.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="repeatType">
<xsd:sequence>
<xsd:element ref="sched:interval" minOccurs="1" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>Defines the time interval between repeats of this trigger.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="count" type="xsd:string" use="optional" default="indefinite">
<xsd:annotation>
<xsd:documentation>count can either be "indefinite" or ant int value.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="intervalType">
<xsd:sequence/>
<xsd:attribute name="weeks" type="xsd:long" default="0" use="optional">
<xsd:annotation>
<xsd:documentation>Week (7 days) component in the interval.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="days" type="xsd:long" default="0" use="optional">
<xsd:annotation>
<xsd:documentation>Day (24 hours) component in the interval.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="hours" type="xsd:long" default="0" use="optional">
<xsd:annotation>
<xsd:documentation>Hour (60 minutes) component in the interval.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="minutes" type="xsd:long" default="0" use="optional">
<xsd:annotation>
<xsd:documentation>Minute (60 seconds) component in the interval.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="seconds" type="xsd:long" default="0" use="optional">
<xsd:annotation>
<xsd:documentation>Second (1000 milli-seconds) component in the interval.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="millisecs" type="xsd:long" default="0" use="optional">
<xsd:annotation>
<xsd:documentation>Milli-second component in the interval.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="messageType" mixed="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any processContents="skip"/>
</xsd:choice>
<xsd:attribute name="date-format" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation>format of date appearing in the meta-data portion of the message sent when this trigger occurs, per http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:element name="schedule" type="sched:scheduleType">
<xsd:annotation>
<xsd:documentation>Defines one or more trigger(s) for this schedule.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="trigger" type="sched:triggerType"/>
<xsd:element name="simpleTrigger" type="sched:simpleTriggerType"/>
<xsd:element name="starting" type="sched:startingType"/>
<xsd:element name="date" type="sched:dateType"/>
<xsd:element name="ending" type="sched:endingType"/>
<xsd:element name="interval" type="sched:intervalType"/>
<xsd:element name="repeat" type="sched:repeatType"/>
<xsd:element name="message" type="sched:messageType"/>
</xsd:schema>
}}}
%%
%%tab-Installation
!! System Requirements
* NetBeans 6.1 with Patch 3 (available via NetBeans Update Center after installing standard NetBeans 6.1, or simply use the OpenESB Installer)
* JDK 1.5 or greater
!! Binaries
* Complete OpenESB Installer available [here|https://open-esb.dev.java.net/Downloads.html]
* A La Carte Binaries
** [Scheduler SE runtime|http://download.java.net/jbi/binaries/open-jbi-components/main/nightly/latest/ojc/schedulerse.jar]
** [Scheduler UI NetBeans Plugin|http://download.java.net/jbi/binaries/open-esb-full-install/nbm/latest/org-netbeans-modules-scheduler-ui.nbm]
** Unofficial [Scheduler UI NetBeans Plugin|SchedulerSE/org-netbeans-modules-scheduler-ui.nbm]
%%
%%tab-ContactUs
! Mailing List
For questions and comments, please subscribe to an appropriate list at [OpenESB Mailing Lists|https://open-esb.dev.java.net/servlets/ProjectMailingListList].
! Contacts
* Developer: [Ed.Wong@Sun.COM|mailto:Ed.Wong@Sun.COM]
%%
%%
__Number of visits:__ [{org.goodjava.plugin.hitcounter.HitCounter}]
! Related Links
* [All OpenESB JBI Components|https://open-esb.dev.java.net/Components.html]
----
!!! Scheduler SE has been deprecated and replaced by [Scheduler BC|SchedulerBC]
----

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-30) was last changed on 20-Jan-09 09:30 AM, -0800 by EdWong