Index Changes

Difference between version and version     

Back to Scheduler BC, or Scheduler BC Info


At line 1 changed 1 line.
%%tabbedSection
<!-- =========================================================================================== -->
<script src="scripts/landingpage.js"></script>
<!-- =========================================================================================== -->
!!!What is the Scheduler BC?
The Scheduler Binding Component (BC), 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.
At line 3 removed 4 lines.
%%tab-About
The Scheduler Binding Component (BC), 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.\\
At line 8 changed 1 line.
%%
!Using the Scheduler BC
* See "[Using the Scheduler Binding Component] (''Guide with tutorial'')"
* See [SchedulerBCTutorial]
!Features
* Systemic Qualities (QoS): please refer to this [blog|http://blogs.sun.com/edwong/entry/systemic_qualities_enhancements]
At line 10 changed 9 lines.
%%tab-Features
!!! %%(color:red)INCUBATOR%% [Status|https://open-esb.dev.java.net/StatusDefinitions.html]
!! Current
* The Scheduler BC currently only supports statically defined triggers (that is, whatever is specified in the Scheduler WSDL Document).
* Support for Quartz [SimpleTrigger|http://www.opensymphony.com/quartz/api/org/quartz/SimpleTrigger.html] (for example, do something every 30 seconds)
* Support for Quartz [CronTrigger|http://www.opensymphony.com/quartz/api/org/quartz/CronTrigger.html] (for example, do something at 1:23 PM on 4/5/2067)
* Support of Systemic Qualities such as:
** [Application Configuration/Variables|JBIComponentConfiguration]
** [Logging|SystemicQualities.Logging]
!System requirements and dependencies
No special requirements
!Trouble?
Please post questions on the [OpenESB mailing list|https://open-esb.dev.java.net/MailingLists.html]. File bugs in the [OpenESB issue tracker|https://open-esb.dev.java.net/IssueTracker.html]; use the {{open-jbi-components}} category and the subcomponent {{Scheduler BC}}.
At line 20 changed 10 lines.
!! In Progress
!! Planned
* Support for dynamically defined and persisted triggers. In other words, a consumer endpoint can send a create new trigger request to the Scheduler BC 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.
* Support for [Fuji|https://fuji.dev.java.net/]
%%
%%tab-Inside
!! Architecture
<!-- =========================================================================================== -->
<script>endBlock1(); beginBlock2(); </script>
<!-- =========================================================================================== -->
!!!Evolution of the Scheduler BC
! What is new?
The Scheduler BC is released as part of GlassFish ESB v2.1
!Team
* Developers working on the Scheduler BC: [Ed.Wong@Sun.COM|mailto:Ed.Wong@Sun.COM]
<!-- =========================================================================================== -->
<script>endBlock2(); beginBlock3(); </script>
<!-- =========================================================================================== -->
!!!Developing the Scheduler BC
!Architecture
At line 32 changed 1 line.
!! Source Code
!Scheduler BC Source Code
At line 35 changed 236 lines.
!! Issue Tracker
* Goto [OpenESB Issue Tracker|https://open-esb.dev.java.net/IssueTracker.html]
* Login
* Select component: __{{open-jbi-components}}__
* and subcomponent: __{{Scheduler BC}}__
%%
%%tab-UserGuide
The Scheduler BC works pretty much the same as any other, such as File BC. However, with the recent WSDL Binding Wizard changes across the board for all BC's, it's worth mentioning how to create a deployment for a Scheduler BC triggering a BPEL to write to a File BC.
!!Create a Scheduler WSDL Document
* Launch the WSDL Binding Wizard by right-clicking over the __{{Process Files}}__ folder of a BPEL project and select __{{New | WSDL Document}}__
** Or equivalently, select __{{New | Other | ESB (Category) | Binding (File Type)}}__ from the __{{Process Files}}__ context menu
[{Image src='SchedulerBC/newSchedBinding.png' align='center'}]
[{Image src='SchedulerBC/newSchedWSDL.png' align='center'}]
* Enter an appropriate __{{File Name}}__ for the WSDL, choose __{{Concrete WSDL Document}}__ for the __{{WSDL Type}}__, select __{{SCHEDULER}}__ from the __{{Binding}}__ drop-down box and press __{{Next}}__
[{Image src='SchedulerBC/defineCtrlTriggers.png' align='center'}]
* To create a Simple trigger, choose __{{Simple}}__ from the __{{Add}}__ combo box or if so already, simply press the __{{+}}__ (plus) button, key in appropriate data and press __{{Add Simple Trigger}}__ button when done
[{Image src='SchedulerBC/addNewTrigger.png' align='center'}]
* Optionally, define a custom date and time format to be used with the scheduler; this format is used both to interpret date and time values persisted in the Scheduler's WSDL as well as displaying the date and time in the message sent to the endpoint being triggered
[{Image src='SchedulerBC/defineCustomDateFormat.png' align='center'}]
* Compose the __{{Format}}__ by selecting from the various date/time component __{{Pattern}}__ drop-down boxes, as well as typing other literals; all the while a __{{Sample}}__ text field illustrates what the date and time will look like
[{Image src='SchedulerBC/configureCustomDateFormat.png' align='center'}]
* As a comparison to Simple trigger that sends a message at periodic intervals of time, let's create a Cron trigger that does so at particular moments in time. Start by choosing __{{Cron}}__ from the __{{Add}}__ combo box
[{Image src='SchedulerBC/addCronTrigger.png' align='center'}]
* We'll start off with a very simple Cron trigger to fire the top of every minute, that is, at the zeroth second.&nbsp; Appropriately fill in __{{Name}}__, __{{Description}}__ and __{{Message}}__ fields and then select the __{{Second (1)}}__ tab if not already done.&nbsp; Select the __{{Just on Second}}__ choice if not already so and the associated spinner to set the second-of-the-minute will be automatically enabled and set this to __{{0}}__.&nbsp; (''Note, the respective controls in the other choices are only enabled if that choice is selected.'')&nbsp; This is the only condition that needs to be defined because all the others are already defaulted appropriately (verifiable in the __{{Cron Expression}}__ text field (see CronExpression JavaDoc [here|http://www.opensymphony.com/quartz/api/org/quartz/CronExpression.html]) and so you can simply press __{{Add Cron Trigger}}__ button
[{Image src='SchedulerBC/specifyCronTrigger.png' align='center'}]
* Although a more complicated Cron Expression generally takes a longer period to run than a demo affords, for illustration sake, let's define one that reminds Americans to vote in the General Election. &nbsp;This is typically the first Tuesday in November every four years, and let's say poll opens at 8:00:00 AM.&nbsp; Start by selecting the __{{Second (1)}}__ tab and __{{Just on Second}}__ choice, and setting the second spinner to zero (0)
[{Image src='SchedulerBC/VoteSecondCond.png' align='center'}]
* Set the __{{Just on Minute}}__ spinner to __{{0}}__, __{{Just on Hour}}__ spinner to __{{8}}__, of the __{{Minute (2)}}__ and __{{Hour (3)}}__ tabs respectively
[{Image src='SchedulerBC/VoteMinuteCond.png' align='center'}]
[{Image src='SchedulerBC/VoteHourCond.png' align='center'}]
* Select the __{{Day-of-Week (6)}}__ tab and select choice __{{On the}}__ and drop down settings __{{First}}__ and __{{TUE}}__
[{Image src='SchedulerBC/VoteDayOfWeekCond.png' align='center'}]
* Having done so, the __{{Day (4)}}__ tab is automatically set to __{{No specific Day of the month}}__ because the Quartz Scheduler API requires it to be mutually exclusive with __{{Day-of-Week}}__
[{Image src='SchedulerBC/VoteDayCond.png' align='center'}]
* Select the __{{Month (5)}}__ tab and choose __{{Just on Month}}__ and month __{{11}}__ (November)
[{Image src='SchedulerBC/VoteMonthCond.png' align='center'}]
* Finally, we need to specify the optional __{{Year (7)}}__ tab by checking on the option box and then select the __{{Starting on Year}}__ choice, setting year to __{{2008}}__ and the __{{repeating every}}__ to __{{4}}__
[{Image src='SchedulerBC/VoteYearCond.png' align='center'}]
* Press __{{Finish}}__ and the new Scheduler WSDL editor appears
[{Image src='SchedulerBC/finishSchedWSDL.png' align='center'}]
[{Image src='SchedulerBC/resultSchedWSDL.png' align='center'}]
!! Create a File WSDL Document
* Similarly, right click over the __{{Process Files}}__ folder again, select __{{New | WSDL Document}}__ and this time create a __{{FILE Binding Concrete WSDL Document}}__ of __{{Type Write}}__ and press __{{Next}}__
[{Image src='SchedulerBC/newFileWSDL.png' align='center'}]
* Specify the respective fields and click __{{Finish}}__
[{Image src='SchedulerBC/finishFileWSDL.png' align='center'}]
!! Create a BPEL and Connect the Components
* Create a new BPEL in the same __{{Process Files}}__ folder and drag and drop the Scheduler WSDL to approximately the middle of the Ports column left of the BPEL canvas
[{Image src='SchedulerBC/dndSchedWSDL.png' align='center'}]
* If it appears, __{{OK}}__ the ensuing dialog confirming creation of Partner Link to represent the Scheduler BC consuming endpoint
[{Image src='SchedulerBC/createSchedPartnerLink.png' align='center'}]
* Similarly, drag and drop the File WSDL to the right column
[{Image src='SchedulerBC/dndFileWSDL.png' align='center'}]
* Again, if the ensuing dialog appears, click the __{{Swap Roles}}__ button since this time the BPEL is the consumer of the service the File BC provides
[{Image src='SchedulerBC/createFilePartnerLink.png' align='center'}]
* Create __{{Receive}}__, __{{Assign}}__, and __{{Invoke}}__ activities in the BPEL and Edit the Receive activity to select the Partner Link representing the Scheduler BC
[{Image src='SchedulerBC/editReceive.png' align='center'}]
[{Image src='SchedulerBC/createSchedInstance.png' align='center'}]
* Press the __{{Create}}__ button to create an __{{Input Variable}}__ for the Scheduler operation by accepting all the default values in the pop-up dialog (not shown) and hit __{{OK}}__ here
[{Image src='SchedulerBC/okReceive.png' align='center'}]
* Similarly edit the __{{Invoke}}__ activity and also create an __{{Input Variable}}__ for the File BC operation
[{Image src='SchedulerBC/okInvoke.png' align='center'}]
* Double click on the __{{Assign}}__ activity and concatentate the __{{date}}__ and __{{payload}}__ fields of the Scheduler input variable, __{{FireTriggerOperationIn}}__ and map to __{{part1}}__ of the File input variable, __{{WriteIn}}__, and __{{Save All}}__ your work
[{Image src='SchedulerBC/mapPayloadToPart1.png' align='center'}]
!! Deploy a Composite Application for Scheduler BC -> BPEL -> File BC
* Create a new __{{Composite Application}}__ project and drag and drop the BPEL project onto the CASA Editor canvas
[{Image src='SchedulerBC/dndBPELToCASA.png' align='center'}]
* Hit the __{{Build}}__ (hammer) button twice (second time to get rid of progress label...known issue)
[{Image src='SchedulerBC/resultSchedBPELFileConnected.png' align='center'}]
* Right click over the CASA project and select __{{Deploy}}__ (you must have a running Glass Fish server with Scheduler Binding Component installed already of course) and you should be getting results in __{{C:\temp\output.xml}}__ like this:
{{{
12 November 2008 at 3:47:31 PM: Do you need more money Joe?
12 November 2008 at 3:48:00 PM: Top of the Minute to you Hank Paulson, please send more money!
12 November 2008 at 3:48:31 PM: Do you need more money Joe?
12 November 2008 at 3:49:00 PM: Top of the Minute to you Hank Paulson, please send more money!
12 November 2008 at 3:49:31 PM: Do you need more money Joe?
12 November 2008 at 3:50:00 PM: Top of the Minute to you Hank Paulson, please send more money!
}}}
!! Scheduler Binding WSDL Document Syntax
Here's what the above WSDL looks like:
{{{
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sched="http://schemas.sun.com/jbi/wsdl-extensions/scheduler/"
name="schedEZLoans" targetNamespace="http://j2ee.netbeans.org/wsdl/bpelSubPrimeOrBust/schedEZLoans" xmlns:tns="http://j2ee.netbeans.org/wsdl/bpelSubPrimeOrBust/schedEZLoans" xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
<wsdl:types>
<xsd:schema targetNamespace="http://schemas.sun.com/jbi/wsdl-extensions/scheduler/">
<xsd:element name="message">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="metadata" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:sequence/>
<xsd:attribute name="date" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="group" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="payload" type="xsd:string" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="TriggerEventMessage">
<wsdl:part name="schedPart" element="sched:message"/>
</wsdl:message>
<wsdl:portType name="TriggerPortType">
<wsdl:operation name="FireTriggerOperation">
<wsdl:input name="inMsg" message="tns:TriggerEventMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TriggerBinding" type="tns:TriggerPortType">
<sched:binding group="schedEZLoans" date-format="dd MMMM yyyy &apos;at&apos; h:mm:ss a"/>
<wsdl:operation name="FireTriggerOperation">
<sched:operation mode="static"/>
<wsdl:input name="inMsg">
<sched:trigger name="SendLoanApplicationStatus" type="simple" enabled="true" description="Trigger sending loan application status to Joe The Plumber" repeat="indefinite" interval="60000" message="Do you need more money Joe?"/>
<sched:trigger name="AskForBailoutMoney" type="cron" enabled="true" description="Trigger requesting more bailout billions from Feds" cron-expr="0 * * * * ?" message="Top of the Minute to you Hank Paulson, please send more money!"/>
<sched:trigger name="VoteTheScoundrelOut" type="cron" enabled="true" description="Remind Americans to vote to save the economy" cron-expr="0 0 8 ? 11 3#1 2008/4" message="Back away from the remote, get up and go vote!"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TriggerService">
<wsdl:port name="schedEZLoans_TriggerPort" binding="tns:TriggerBinding">
<sched:active-period starting="now" ending="never" timezone="America/Los_Angeles"/>
</wsdl:port>
</wsdl:service>
<plnk:partnerLinkType name="schedEZLoans">
<!-- A partner link type is automatically generated when a new port type is added. Partner link types are used by BPEL processes.
In a BPEL process, a partner link represents the interaction between the BPEL process and a partner service. Each partner link is associated with a partner link type.
A partner link type characterizes the conversational relationship between two services. The partner link type can have one or two roles.-->
<plnk:role name="TriggerPortTypeRole" portType="tns:TriggerPortType"/>
</plnk:partnerLinkType>
</wsdl:definitions>
}}}
!! Systemic Qualities (QoS)
* Please refer to this [blog|http://blogs.sun.com/edwong/entry/systemic_qualities_enhancements]
%%
%%tab-Installation
!! Binaries
In order to try out the Scheduler BC:
* You'll need to run the latest official __OpenESB__ or __GlassFish ESB__ Installer for the desired platform from [here|https://open-esb.dev.java.net/Downloads.html] (__as of 9 December 2008__)
* Otherwise, official a-la-carte binaries are available:
** Scheduler WSDL Binding Extension NetBeans [plug-in|http://download.java.net/jbi/binaries/open-esb-full-install/nbm/latest/org-netbeans-modules-wsdlextensions-scheduler.nbm] (you may need to rename it back to a .nbm extension after downloading)
** Scheduler BC GF [plug-in|http://download.java.net/jbi/binaries/open-jbi-components/main/nightly/latest/ojc/schedulerbc.jar]
%%
%%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]
<!-- =========================================================================================== -->
<script>endBlock3(); endBlocks();</script>
<!-- =========================================================================================== -->

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-37) was last changed on 16-Jun-09 23:01 PM, -0700 by FrankKieviet