Using the Scheduler Binding Component

Steps to Create the BPEL Project

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

  1. Create a New BPEL Project

  2. Create a Scheduler Binding Component

  3. Create a File Binding Component

  4. Create a BPEL Process

  5. Create a Composite Application

  6. Build and Deploy the Project

ProcedureCreate 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.

    The SayHello Project is added to the Projects tree.

ProcedureCreate 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” and repeats it four times in five second intervals for a total of five messages.

  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.

ProcedureCreate 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.

ProcedureCreate 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.

ProcedureCreate 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

ProcedureBuild 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's output as described
in context

    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.