Friday Dec 05, 2008

Systemic Qualities Enhancements

To make it even more useful, some essential Systemic Qualities have been added to Scheduler BC

  • Application Configuration

    You may have noticed a small icon (looks like an Application icon with a gear cog in it) affixed to the left of some labels in Scheduler trigger definition panel:



    As the tool tip indicates, these parameters are part of the available Application Configuration for the Scheduler Binding Component, and can be optionally configured at deployment time.  This is essential for Administrators in order to deploy a project, after Development and Quality Assurance have finished their tasks in the project lifecycle, since the run-time environment(s) that may be quite different in terms of locale.


    • To start, you need to associate a Configuration Extension profile with the respective Scheduler endpoint by clicking on the consumer icon of the Scheduler port in the CASA editor and selecting Properties:



    • Now, enter the desired name of the profile, such as the name given to the Scheduler WSDL (binding):



    • Next under the Services tab, make sure the GlassFish V2 Server and Scheduler Binding Component (sun-scheduler-binding) have been started, then right-click sun-scheduler-binding and select Properties:



    • Then, click Add button to add a new row representing all the Application configurable parameters for the Scheduler BC, using the same name for the Application Configuration Name as given in the CASA editor.

      Pay particular attention to values given for the startDate and endDate; they need to either be the string literals now and never respectively or, dates conforming to the format specified in Date Format of the GUI editor when the Scheduler WSDL (binding) was first created or subsequently edited.




    Now when the Composite Application is deployed, the Scheduler BC will use those Application Configuration that have been defined for the respective endpoint.

    Besides using NetBeans IDE to specify Application Configuration, you can also use:



  • Application Variables

    The message sent when a trigger is fired can now reference Application Variables that are set at deployment time and will be evaluated each and everytime prior to the message being sent; this allows the variables to be changed dynamically.  This feature is useful if the message sent contains confidential information such as passwords that firstly, you don't want to reveal statically in the message while it's being configured in either the Simple or Cron trigger editor.  Secondly, passwords used in enterprises often require periodic maintenance for security reasons and thus the runtime administrators need access to these, without touching the business logic specified during design time and verified during quality assurance.  To utilize Application Variables:

    • Reference them in the Message field of the trigger editor, using the dollar sign curly braces format (highlighted in following figure):



      Note, any Application Variable defined is available to all JBI applications deployed in a GlassFish server and thus care needs to be taken to qualify these for different deployments, typically by prefixing their names with a unique key such as the name of the WSDL binding ("cronBinding." as shown here.

    • Next, prior to deployment time, set the referenced Application Variables by right-clicking the GlassFish V2|JBI|Binding Components|sun-scheduler-binding node in the Services tab, select Properties and click on the ellipsis ("...") button for the Application Variables property in the Configuration section. Press the Add button and choose the type of variable desired, such as a Password type:



    • For each Application Variable, enter the Name exactly as referenced in the Message field, of course omitting the dollar sign and curly braces, and the corresponding value (note, Password fields are masked out for confidentiality); the latter cannot reference another Application Variable.



      Press OK when done and the Application Variables are ready for use by the deployment:



    • Like Application Configuration, Application Variables can also be configured using the Sun Java System Application Server (GlassFish) Admin Console:



    • Similarly, there are asadmin CLI commands to create (create-jbi-application-variable), update (update-jbi-application-variable, and delete (delete-jbi-application-variable) Application Variables.

    Here's the output using the configured Application Variables:



  • Logging

    Scheduler BC now emits more detailed and controllable logging.  Each log entry starts with an ID SCHEDBC-Xyyy where X is a digit that represent 7 different logging levels: 1 (FINEST), 2 (FINER), 3 (FINE), 4 (CONFIG), 5 (INFO), 6 (WARNING), and 7 (SEVERE) that are explained here.  Note, levels 1 through 3 inclusive are not internationalized as they represent debugging levels.

    Here's a sample output:

Friday Oct 17, 2008

Scheduler Redux

The surgery was successful and the patient has become a BC!  Anyhow, 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


  • 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
  • Press the Add button to add a new Trigger, key in appropriate data and press Add Trigger button when done

  • 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

  • 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

  • Press Finish and the new Scheduler WSDL editor appears

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

  • Specify the respective fields and click Finish

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

  • OK the ensuing dialog confirming creation of Partner Link to represent the Scheduler BC consuming endpoint

  • Similarly, drag and drop the File WSDL to the right column

  • In the ensuing dialog, click the Swap Roles button since this time the BPEL is the consumer of the service the File BC provides

  • Create Receive, Assign, and Invoke activities in the BPEL and Edit the Receive activity to select the Partner Link representing the Scheduler BC

  • 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

  • Similarly edit the Invoke activity and also create an Input Variable for the File BC operation

  • Double click on the Assign activity and map from the payload of the Scheduler input variable to part1 of the File input variable, and Save All your work

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


  • Hit the Build (hammer) button twice (second time to get rid of progress label...known issue)


  • 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:


Installation Binaries

  • You'll need to run the latest OpenESB or GlassFish ESB Installer for the desired platform from here (as of 24 October 2008) and it will have both design-time and run-time Scheduler BC components pre-installed.
  • Otherwise, a-la-carte binaries are available for:
    • Scheduler WSDL Binding Extension NetBeans plug-in (you may need to rename it back to a .nbm extension after downloading)
    • Scheduler BC GF plug-in
About

Edward Wong

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today