Using the File Binding Component

Creating a BPEL Module Project

This section provides step-by-step directions to create a simple BPEL module project called PollInOut, and also provides instructions to create a WSDL document, BPEL process, adding partner links and to clean and build the BPEL module project.

ProcedureTo Create a BPEL Module Project

  1. From the NetBeans IDE's main menu, choose File -> New Project.

    The New Project wizard opens.

  2. In the Categories list, select the SOA node and in the Projects list select BPEL Module and click Next.

    Selecting the Category and the Project
  3. In the Project Name field, type PollInOut.

    You can choose to change the Project Location or just use the default location.

  4. Leave the Set as Main Project option selected and click Finish.

    Selecting the Project Location

    The Projects window now contains a node for the BPEL Module project called PollInOut.

ProcedureTo Create the WSDL Document for Type Poll

  1. In the Projects window, expand the PollInOut Module, right-click the Process Files node, and choose New -> WSDL Document from the pop-up menu.

    The New WSDL Document dialog box appears.

    Creating the WSDL Doc for Type Poll
  2. In the File Name field type PollIn.

  3. In the WSDL Type, select the Concrete WSDL Document option.

  4. In the Binding field, select FILE and in the Type field, select Poll and click Next.

    The Request Configuration page appears.

    The Request Configuration Page
  5. In the File Name* (pattern) field, change input.xml to input.text.

    You can specify the file name as .txt or else use .xml, but it must be same as the input file type

    Note that the Polling Directory is c:/temp by default. You can change the directory if required.

  6. Click Finish.

    The Projects window now has a node PollIn.WSDL under Process Files node.

ProcedureTo Create the WSDL Document for Type Write

  1. In the Projects window, expand the PollInOut Module, right-click the Process Files node, and choose New -> WSDL Document from the pop-up menu.

    The New WSDL Document dialog box appears.

    Creating the WSDL Doc for Type Write
  2. In the File Name field type PollOut.

  3. In the WSDL Type, select the Concrete WSDL Document option.

  4. In the Binding field, select FILE and in the Type field, select Write and click Next.

    The Request Configuration page appears.

    The Request Configuration Page for Write
  5. In the File Name* (pattern) field, change output.xml to output.text.

    You can specify the file name as .txt or else use .xml, but it must be the same as the output file type.

    Note that the Path is c:/temp by default. You can change it if required.

  6. In File Exists, select the Overwrite Existing File option.

  7. Click Finish.

    The Projects window now has a node PollOut.WSDL under Process Files node.

ProcedureTo Create a BPEL Process

  1. In the Projects window, expand the PollInOut Module, right-click the Process Files node, and choose New -> BPEL Process from the pop-up menu.

    The New BPEL Process dialog box appears.

    BPEL Process Dialog Box
  2. In the File Name field type PollWrite and click Finish.

    The Projects window now has a node PollWrite.BPEL under Process Files node.

    You can now see the new BPEL file, PollWrite in the Design view.

    Design View with PollWrite

    If the Palette and Properties windows are not displayed in your current view, click Windows -> Palette on the NetBeans menu.

ProcedureTo Add Partner Links to the BPEL Process

  1. In the Projects window, expand PollInOut and Process Files nodes and select the PollIn.wsdl file.

  2. Drag the PollIn.wsdl file from the Projects window to the left side of the Design view canvas.

    The IDE provides visual prompts to show you where you can drop the selection. The BPEL Editor adds a partner link to the canvas.

    Adding PartnerLink1 to the BPEL
  3. Now, select the PollOut.wsdl file from the Projects window and drag it to the right side of the Design view canvas.

    Adding PartnerLink2 to the BPEL

ProcedureTo Add a Receive Activity to the BPEL Process

  1. From the Palette window, in the Web Service section , select the Receive activity and drag it to the PollWrite process box in the Design view canvas, between the Process Start and the Process End activities.

    The Receive1 activity is added to the process box.

    Adding Receive Activity to the BPEL
  2. Click the Receive1 activity's Edit icon.

    The Receive1 Property Editor appears.

    Receive Activity Property Editor
  3. On the Main tab, accept the value in the Name field. From the Partner Link drop-down list, choose PartnerLink1. The IDE populates the Operation field with Poll.

  4. Click the Create button next to the Input Variable Field. The New Input Variable dialog box appears. Click OK to accept the default values.

  5. Click OK to close the Receive1 Property Editor.

    The Design view displays the new connection between PartnerLink1 and the Receive1 in the process box.

    Connection Between PartnerLink1 and Receive1

ProcedureTo Add an Invoke Activity to the BPEL Process

  1. From the Palette window, in the Web Service section , select the Invoke activity and drag and drop it to the prompt between the Receive1 activity and the Process End activity in the process box on the design view canvas.

    A Invoke1 activity is added to the design view canvas.

    Adding Invoke Activity
  2. Click the Invoke1 activity's Edit icon.

    The Invoke1 Property Editor appears.

    Invoke Activity Property Editor
  3. On the Main tab, accept the value in the Name field. From the Partner Link drop-down list, choose PartnerLink2. The IDE populates the Operation field with write.

  4. Click the Create button next to the Input Variable Field. The New Input Variable dialog box appears. Click OK to accept the default values.

  5. Click OK to close the Invoke1 Property Editor.

    The Design view displays the new connection between PartnerLink2 and the Invoke1 in the process box.

    Connection Between PartnerLink2 and Invoke1

ProcedureTo Add an Assign Activity to the BPEL Process

  1. From the Palette window, in the Basic Activities section, select Assign and drag and drop it the prompt between the Receive1 activity and the Invoke1 activity in the process box on the design view canvas.

    The Assign1 activity is added to the design view canvas.

    Adding Assign Activity
  2. Select the Assign1 activity and click the Mapper button on the editors toolbar.

    The BPEL Mapper appears.

  3. Map the part1 node under Variables -> PollIn1 in the Output pane of the BPEL Mapper, to the part1 node under Variables -> WriteIn1 in the Input pane of the Mapper.

    To do this, select the part1 node in the Output pane, and drag your cursor to the part1 node in the Input pane.

    Mapping Part1 to Part1

    This assignment copies the input statement into the output.

  4. Click the Save All icon on the IDE toolbar.

ProcedureTo Clean and Build the BPEL Module Project

  1. In the Projects window right-click the PollInOut node and choose Clean and Build from the pop-up menu.

    When the build is complete the Output window reports BUILD SUCCESSFUL.

    If the Output window is not visible, from the NetBeans IDE's menubar choose Window -> Output -> Output.