Index Changes
This is version 6. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

Using the Scheduler Binding Component

Contents


Creating a Scheduler Binding Component Project



This section allows you to “get your hands dirty,” creating a sample Scheduler Binding Component project that contains all three different trigger types, Simple, Cron, and Hybrid. In this sample you create a schedule file to trigger a BPEL provider endpoint with a message and begin a business process instance that performs a task.

These directions assume that you are generally familiar with GlassFish ESB and the NetBeans IDE, and that GlassFish ESB is installed and running.

Steps to Create the BPEL Project

The following procedures are used to create the sample Scheduler Project:

  • Create a New BPEL Project
  • Create a Scheduler Binding Component
  • Create a File Binding Component
  • Create a BPEL Process
  • Create a Composite Application
  • Build and Deploy the Project

Create a New BPEL Project

  1. Choose File → New Project (Ctrl-Shift-N).
    The New Project Wizard appears.
  2. Select SOA in the Categories list, and BPEL Module in the Projects list. Click Next.
  3. Name the project SayHello, and click Finish.
    TheSayHello Project is added to the Projects tree.


Create a Scheduler Binding Component

  1. From the Project tree, right-click the SayHello node and select New → WSDL Document.
    The WSDL Document Wizard appears.
  2. Enter HelloTriggers as the file name.
  3. Select Concrete WSDL Document as the WSDL type, and select SCHEDULER as the binding.
    Image shows the WSDL Document Wizard with settings to create a SCHEDULER Binding

  4. Click Next.
    The Scheduler Control and Triggers Wizard appears.
  5. From the Scheduler wizard's Add field, select Simple. Click the plus sign next to the Add field to open the Add New Simple Trigger dialog box.
    Image displays the Scheduler Control and Triggers Wizard

  6. From the Add New Simple Trigger dialog box, add the following values:
    • Name: SimpleTrigger1
    • Description: Say Hello first 20 seconds
    • Repeat: 4
    • Interval: 5
    • Message: Hello first 20 seconds
      Image shows the Add New Simple Trigger dialog box as described in context

      This creates a trigger that sends the message “Hello first 20 seconds” four times in five second intervals.
  7. Click Add Simple Trigger.
    SimpleTrigger1 is added to the Triggers field.
  8. Now create a Cron trigger. Change the Add field value to Cron and click the plus sign next to the Add field.
    The Add New Cron Trigger dialog box appears.
  9. From the Add New Cron Trigger dialog box, add the following values:
    • Name: CronTrigger1
    • Description: Say Hello at the bottom of each minute
    • From the Second (1) tab, select Just on Second: and select 30 as the value. Leave remaining tabs at their default values.
    • Message: Hello at the bottom of each minute
      Image shows the Add New Cron Trigger dialog box as described in context

      This creates a trigger that sends the message “Hello at the bottom of each minute” every minute at second 30, indefinitely.
  10. Click Add Cron Trigger.
    CronTrigger1 is added to the Triggers field.
  11. Now create a Hybrid trigger. Change the Add field value to Hybrid and click the plus sign next to the Add field.
    The Add New Hybrid Trigger dialog box appears.
  12. From the Add New Hybrid Trigger dialog box, add the following values:
    • Name: HybridTrigger1
    • Description: Say Hello for the last 20 seconds of each minute
    • From the Second (1) tab, select Just on Second: and select 40 as the value. Leave remaining tabs at their default values.
    • Duration: 20 Seconds
    • Repeat: Indefinite
    • Interval: 5
    • Message: Hello for the last 20 seconds of each minute
      Image shows the Add New Hybrid Trigger dialog box as described in context

      This creates a trigger that sends the message “Hello for the last 20 seconds of each minute” every five seconds, from second 40 through 59 of each minute, indefinitely.
  13. Click Add Hybrid Trigger.
    HybridTrigger1 is added to the Triggers field.
  14. Click Finish to create the new WSDL document.
    Image shows the New WSDL Document Wizard containing three triggers

    The HelloTriggers WSDL document is added to the SayHello Project's process files.


Create a File Binding Component

  1. From the Project tree, right-click the SayHello Project and select New → WSDL Document.
    The WSDL Document Wizard appears.
  2. Enter the following values:
    • Name: FileBC
    • WSDL Type: Concrete
    • Binding: FILE
    • Type: Write
      Image shows the New WSDL Document wizard as described in context

  3. Click Next
  4. On the Request Configuration page of the New WSDL Document wizard, enter the following values.
    • File Exists: Append to Existing File
    • Payload Processing: Text
      Image shows the New WSDL Document wizard as described in context

  5. Click Finish.
    The new WSDL file is added to the SayHello Project's process files.


Create a BPEL Process

  1. From the Projects window, double-click newProcess.bpel under your projects Process Files.
    The BPEL Designer opens to the new file.
  2. From the projects tree, drag and drop HelloTriggers.wsdl to the middle of the Ports column on the left side of the BPEL Designer. A “drop-zone” appears, as a prompt.
    Image displays the BPEL Designer as described in context

    A Partner Link is created.
  3. In the same way, drag and drop the FileBC.wsdl file to the drop-zone in the right column of the BPEL Designer.
    Another Partner Link is created.
  4. Create a Receive web service.
    1. From the BPEL Designer Palette, drag and drop a Receive web service to the drop-zone between Process Start and Process End in the middle of the BPEL Designer.
    2. Click the Receive activity's Edit icon.
      The Receive1 Property Editor appears.
      Image shows the Receive1 Property Editor

    3. Select PartnerLink1 as the Partner Link value.
    4. For Input Variable, click the create button. The New Input Variable dialog box appears. Click OK to accept the current values.
    5. Click OK. The BPEL Designer now displays the Receive activity associated with PartnerLink1

  5. Create an Invoke web service.
    1. From the BPEL Designer Palette, drag and drop an Invoke web service to the drop-zone just below the Receive Activity in the middle of the BPEL Designer.
    2. Click the Invoke activity's Edit icon.
      The Invoke1 Property Editor appears.
      Image shows the Invoke1 Property Editor

    3. Select PartnerLink2 as the Partner Link value.
    4. For Input Variable, click the create button. The New Input Variable dialog box appears. Click OK to accept the current values.
    5. Click OK. The BPEL Designer now displays the Invoke activity associated with PartnerLink2
      Image shows the BPEL Designer as described in context


  6. Drag and drop an Assign activity to the drop-zone between the Receive activity and Invoke activity.
  7. Double-click the Assign activity to open the BPEL Mapper.
  8. Map SchedPart, under FireTriggerOperationIn in the Output pane of the Mapper, to part1, under WriteIn in the Input pane of the Mapper. To do this, click the SchedPart node in the left pane of the Mapper, and drag it to WriteIn in the right pane of the Mapper. A line now associates the two nodes.
    Image shows the BPEL Mapper as described in context

  9. Click Save All.


Create a Composite Application

  1. To create the new Composite Application, choose File → New Project.
    The New Project Wizard appears.
  2. Select SOA as the Category, and Composite Application as the Project, and click Next.
  3. Name the project SayHelloCA, and click Finish.
    The SayHelloCA Composite Application is added to the Projects tree, and the Composite Application Service Assembly (CASA) Editor opens to the SayHelloCA.casa file.
  4. Drag and drop the SayHello BPEL Project from the Projects tree to the JBI Modules column of the CASA Editor.
  5. Build the Composite Application project. To do this, click the Build (hammer) icon in the CASA toolbar.
    Image shows the SayHello Composite Application in the CASA Editor

  6. Click Save All


Build and Deploy the Project

  1. From the Projects window, right-click the SayHelloCA Composite Application Project and choose Clean and Build from the popup menu.
    The NetBeans IDE Output window message reports Build Successful when complete.
  2. Right-click SayHelloCA again and select Deploy from the popup menu.
    Again, the NetBeans IDE Output window message reports Build Successful when complete.
  3. Open your project's output file, for this example C:\TEMP\output.xml. The output appears similar to the image below, depending on when the project is started.
    Images shows the SayHelloCA Project

    As you can see from the output, the Simple trigger fired for 20 seconds only, producing the first messages, the Cron trigger fires once at the bottom of each minute, and the Hybrid trigger fires the last 20 seconds of each minute.
  4. To stop your project, right-click the SayHelloCA Project in the Projects window, and choose Undeploy from the popup menu.


Previous
Next

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This particular version was published on 01-May-09 12:22 PM, -0700 by rjacobus