Using the Database Binding Component

Creating a BPEL Process

In this section, you add a BPEL process file, for example, BPELProcess.bpel. Add a partner link and three activities to the BPEL process file.

ProcedureTo Create a BPEL Process

  1. Expand the BPEL Module project node in the Projects window.

    For example, BpelModuleSample

  2. Right-click the BPEL Module project name or Process Files node. Choose New —> BPEL Process...

    For example, BpelModuleSample

    BPEL Process

    This opens the New BPEL Process wizard.

  3. Type the File Name in the File Name field.

    For example, BPELProcess

  4. Click Finish.

    BPEL Created
    Note –
    • In the Projects window, the IDE adds a BPELProcess.bpel node under the Process Files node.

    • The BPELProcess.bpel file is open in the BPEL Designer.

    • The Properties window is open.

    • If you do not see the Properties window, choose Window —> Properties.

    • The Navigator window is open showing the BPEL Logical View of the BPEL Process document.


ProcedureTo Add a Partner Link

  1. Select the Partner Link from the Projects tab.

    For example, SOAPWSDL.wsdl

    This is the Input WSDL.

  2. Drag and drop the SOAP WSDL Document to the left panel of the design area.

    For example, SOAPWSDL.wsdl

    SOAP WSDL BPEL Created
  3. Select the Partner Link from the Projects tab.

    For example, dbWSDL.wsdl

    This is the Output WSDL.

  4. Drag and drop DATABASE WSDL Document to the right panel of the design area.

    For example, dbWSDL.wsdl

    db WSDL BPEL Created

ProcedureTo Add a Web Service and Basic Activities

Drag and Drop the following Web Services:

Drag and Drop the Basic Activities : Assign1 and Assign2.

  1. Select the Web Service : Receive in the Web Service section of the Palette.

  2. Drag the selection to the BPELProcess box in the design area between the Process Start and the Process End activities.

    The IDE provides the visual clues to show an appropriate location to drop the selection.

    Select Activity Receive

    This action places a Web Service Receive called Receive1 in the Design view.

  3. Select the Basic Activities — Assign in the Basic Activities section of the Palette.

    This action places a Assign activity called Assign1 in the Design view.

  4. Drag the selection to the BPELProcess box in the design area, between the Process Start and the Process End activities.


    Note –

    Repeat steps 1 through 4 to select Invoke1, Assign2, and Reply1.

    Choose the following:

    • Select the Web Service : Invoke and Basic Activities : Assign.

    • Select the Web Service ; Reply.


    Select All Activities
    Note –

    In the diagram, a red cross next to an element means that the element has not passed validation and the output contains errors. Edit each Sequence to pass validation.


    The icon symbolizes that the Web Services can be edited.

    Edit Enabled

ProcedureTo Edit Web Service : Receive1

  1. Click Web Service — Receive1 and click Edit.

    This opens the Receive1 [Receive] - Property Editor.

  2. Select the properties from the Main tab. Select PartnerLink1 from the drop-down list.

    The IDE fills in the Operation field with SOAPWSDLOperation.

    Receive Property Editor
  3. Create a new input variable.

    Perform the following:

    • Click the Create button next to the Input Variable field.

      This opens the New Input Variable dialog box.

    • The Name, Type, and Scope are displayed, by default.

      You can also change the value in the Name field.

    • Click OK.

    Input Variable
    Note –

    All the fields are populated with the assigned values.

    Input Variable — SOAPWSDLOperationIn


    Receive Property Editor
  4. Click OK to close the Receive1 [Receive] - Property Editor.

  5. Click Save All.

    Receive Edit Map

ProcedureTo Edit the Web Service : Invoke1

  1. Click Web Service — Invoke1 and click Edit.

    This opens the Invoke1 [Invoke] - Property Editor.

  2. Select the properties from the Main tab. Select PartnerLink2 from the drop-down list.

    Select any one of the Operations from the drop-down list.

    • Insert

    • Update

    • Delete

    • Find

    • Pollrecords

    Select Operation — find from the drop-down list. The IDE fills in the Operation field.

    Invoke Property Window
  3. Follow the steps to create a new input and an output variable.

    1. Click the Create button next to the Input Variable field.

      This opens the New Input Variable dialog box.

      New Input Variable

      The Name, Type, and Scope are displayed, by default.

      You can also change the value in the Name field.

    2. Click OK to close the New Input Variable dialog box.

    3. Click the Create button next to the Output Variable field.

      This opens the New Output Variable dialog box.

      New Output Variable

      The Name, Type, and Scope are displayed, by default.

      You can also change the value in the Name field.

    4. Click OK to close the New Output Variable dialog box.


    Note –

    All the fields are populated with the assigned values.

    Select the following Variables:

    • Input Variable : FindIn

    • Output Variable : FindOut


    Find In Find Out Property Editor
  4. Click OK to close the Invoke1 [Invoke] - Property Editor.

  5. Save the project.

    Invoke Edit Find Map

ProcedureTo Edit the Web Service : Reply1

  1. Click Web Service : Reply1. Click Edit.

    This opens the Reply1 [Reply] - Property Editor.

  2. Select the properties from the Main tab. Select PartnerLink1 from the drop-down list.

    The IDE fills in the Operation field with SOAPWSDLOperation.

    Reply Editor
  3. Follow the steps to create a New Output Variable.

    1. Make sure to select the Normal Response radio button.

    2. Click the Create button next to the Output Variable field.

      This opens the New Output Variable dialog box.

      Reply New Output
    3. Change the value in the Name field. This is optional.

      Reply1 is displayed, by default.

    4. Click OK.

    Reply Property Editor
  4. Click OK to close the Reply1 [Reply] - Property Editor.

    Final Mapper IRR

ProcedureTo Edit the Basic Activities : Assign1

  1. Double-click the Basic Activity : Assign1.

    This displays the BPEL Mapper window.

  2. Expand the node in the Source tree pane (the left pane) of the BPEL Mapper under Output —> Variables.

    For example, SOAPWSDLOperationIn

    A part1 node appears under the SOAPWSDLOperationIn node.

  3. Expand the node in the Destination tree pane (the right pane) of the BPEL Mapper under Input —> Variables.

    For example, FindIn

    A part node appears under the FindIn node.

  4. Select the node in the Source tree pane.

    For example, SOAPWSDLOperationIn — part1 — CUSTOMER_Record

  5. Drag the selection and map it to the node in the Destination tree pane.

    For example, FindIn — part — CUSTOMER_Record

    For example, Map the following Variables:

    1. NAME — NAME

    2. CUSTOMER_ID — CUSTOMER_ID

    Assign Mapper
  6. Click the Design tab.


    Note –

    A red icon marked against Basic Activities — Assign1 is not shown.


    Assign Cleared

ProcedureTo Edit the Basic Activities : Assign2

  1. Double-click the Basic Activity : Assign2.

    This displays the BPEL Mapper window.

  2. Expand the node in the Source tree pane (the left pane) of the BPEL Mapper under Output — Variables.

    For example, FindOut

  3. Expand the node in the Destination tree pane (the right pane) of the BPEL Mapper under Input — Variables.

    For example, SOAPWSDLOpertionOut

  4. Select the node in the Source tree pane.

    For example, FindOut : part : CUSTOMER_Record

  5. Drag the selection to the node in the Destination tree pane.

    For example, SOAPWSDLOpertionOut : part1 : CUSTOMER_Record

    For example, Map the following variables:

    1. PHONE : PHONE

    2. STATE : STATE

    3. NAME : NAME

    4. ZIP : ZIP

    5. ADDRESSLINE1 — ADDRESSLINE1

    6. ADDRESSLINE2 — ADDRESSLINE2

    7. CREDIT_LIMIT — CREDIT_LIMIT

    8. EMAIL — EMAIL

    9. CUSTOMER_ID — CUSTOMER_ID

    10. CITY — CITY

    11. FAX — FAX

    12. DISCOUNT_CODE — DISCOUNT_CODE

      Finally, map part : part1.

    Assign2 Mapper
  6. Click the Design tab.

    The final output is as shown in the illustration.

    Final Mapper
  7. Right-click the project node and select Clean and Build.

    For example, BpelModuleSample

    The following message is displayed.


    BUILD SUCCESSFUL (total time: 2 seconds).
  8. Click Save All.