Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Swordfish Documentation: Designing BPEL Eclipse BPEL Designer

Creating BPEL Process Skeleton

  1. Select File > New Wizard >BPEL 2.0>BPEL project to create a new BPEL project and name it, FlightBooking.
  2. Next, create a BPEL file New Wizard >BPEL 2.0 >New BPEL Process File. In the BPEL file wizard window enter:
  3. Open the newly created FlightBookingProcess.bpel with BPEL Designer by double click you should see visual representation of empty BPEL process (see image)
    Empty-bpel.png
  4. Expand BPEL elements Palette by clicking on Arrow highlighted on next image:
    Bpel-element-palette.png
  5. Using Element Palette create initial BPEL Process Skeleton as displayed on the image:
    Bpel-process-skeleton.png

Setting Up BPEL WSIL Browser

To create Partner Link to external web service and expose BPEL process as web service we need set of corresponding wsdl files. In current demo those files should be accessed from Swordfish Registry.

  1. Start Swordfish Service Registry, [download]) and install there 3 wsdl files (FlightBooking.wsdl, FlightReservation.wsdl and PaymentProcessing.wsdl). Service Registry automatically provide WSIL file for installed WSDLs, default url is http://localhost:9001/registry/wsil, see image
    Wsil.png
  2. To have ability to access and import above mentioned wsdl files we need to initialize BPEL WSIL Browser. Go to Preference->BPEL->WSIL Brower set "Document Url" field as http://localhost:9001/registry/wsil. Press OK.
    Init-wsil-browser.png
  3. IMPORTANT: Service Registry should be up and running during next design steps and process execution phase.

Creating Partner Links

At the created Process Diagram we have one receive-type element (with same name "Receive") and two invoke-type element ("processReservation" and "paimentProcessing"). For Receive-type element we need InBound endpoints and for receive-type we need to create OutBound endpoints. To create Partner Link we need to import corresponding wsdl file to BPEL process.

Creating Receive InBound Partner Link

  1. click on "Receive" element on BPEL diagram. Open Properties view and click on Details tab. You should see empty Partner Link and Operation Fields. Expand Partner Link dropdown and choose Create Global Partner Link item:
    Parnter-link-field.png
  2. In New Parner Link window type FlightBooking name.
  3. Next window Choose Partner Link Type will be empty by default. To see available types we need to import corresponding WSDL files. Click on Add WSDL button
    Empty-choose-partner-link-window.png
  4. In the Browse for a WSDL to Import activate WSIL radio button and it your Swordfish Registry Up and Running and BPEL WSIL Browse setted up well, you should see Inspection tree including 3 wsdl files. For this step you need to click on 'FlightBooking.wsdl' and precc OK.
    Choose-flight-booking-wsdl.png
  5. repeat previous step form 'FlightReservation.wsdl' and 'PaymentProcessing.wsdl' files.
  6. now your New Parner Link windows should looks like on image below, click on 'FlightBooking' item from Matches area and click OK.
    Choose-partner-link-fool.png
  7. for the next window set Partner Link Type Name with the same value as Partner Link Name: 'FlightBooking'. Click on to go to next step of partner link type creation
  8. in the next window enter 'InBound' for Role Name field and select FlightBooking port type from list below(see image). Press Finish.
    Create-parther-link-type.png
  9. leave Set Namespace Prefix window fields as it is.
  10. After partner link creating finished get back to BPEL diagram and check changes:
    1. new Partner Link 'FlightBooking' now visible on BPEL process sidebar
    2. in properties pane for 'Receive' element Partner Link should become initialized with just created partner link name.
    3. in properties pane for 'Receive' element Operation link still empty.
    Properties-and-new-partner-link.png
  11. We still need to set Operation field for 'Receive' element, easiest way do to this is to click on 'fligthBooking' operation icon from Qick Pick element tree. Additionally you could notice that new process variable 'FlightBookingRequest' has been automatically created and assigned to current partner link:
    Set-operation-and-new-variable.png

Creating flightRecervation OutBound Partner Link

Select flightRecervation element in BPEL designer to edit its' properties and make same set of action as above.

Notice:

  • Partner Link Name and Partner Link Type Name should be 'FlightRecervation'
  • Partner Link Role Name should be setted as 'OutBound'
  • Operation name for FlightRecervation partner link is reserveFlight

Creating paymentProcessing OutBoing Partner Link

Select paymentProcessing element in BPEL designer to edit its' properties and make same set of action as above.

Notice:

  • Partner Link Name and Partner Link Type Name should be 'PaymentProcessing'
  • Partner Link Type Role Name should be setted as 'OutBound'
  • Operation name for PaymentProcessing partner link is paymentProcessing

Creating Reply Partner Link

Select paymentProcessing element in BPEL designer to edit its' properties. No Partner Link creating needed this time, we will use existing FlightBooking partner link. Set Properties pane values as on image below.

NOTICE: ater you'll set Operation value, new variable 'FlightBookingResponse' should automatically created.

Reply-partner-link.png

Assign-type elements initialization

Assign elements using to transit data from one BPEL logic elements to another.

In our case we need:

  • pass initial request data from Receive element to flightRecervation element (Assign)
  • pass flightReceration element's response to paymentProcessing element (Assign1)
  • pass paymentData element's response to Rely element (Assign2)

Initialization of the first Assign Element(element name: 'Assign')

  1. click on Assign element on the top of BPEL diagram and open Properties->Details tab. It will be empty by default.
    Assign-properties-empty.png
  2. click on New button to create new assign statement, this will populate From and To variables trees.
    1. expand 'FlightBookingRequest' item from From list (left side) and select parameters: bookFlight->flightData: FlightData item
    2. expand 'FlightReservationRequest' item from To list (right side) and select parameters: reserveFlight->flightData: FlightData item
    Assign-variable-to-variable.png
    We just created Variable to Variable assignment. It pass initial request to FlightReservation service. But FlightReservationRequest variable need additional initialization before assignment execution. BPEL Designer takes responsibilities to generate this initialization part automatically, but we need to help him to do this.
  3. Click on some empty area on process diagram pane. In reaction You should see this popup in reaction
    Assign-initialization-request.png
  4. Click OK and get back to Assign Properties->Details tab. You should see there new "Fixed Value to Variable" assignment.
    Assign-fixed-value-to-var.png
  5. as you might guess this statement assigns xml-string to FlightReservationRequest before "Variable to Variable" assign statement execution. Wee need this to create well formed request to Flight Reservation service. First Assign element initialization DONE!

Initialization of the second Assign Element(element name: 'Assign1')

The same set of actions as for first assign elements. But with different variables section:

  • From FlightBookingRequest->paymentData
  • To PaymentProcessingRequest->paymentData
  • IMPORTANT: don't forget about additional initialization using 'Fixed Value to Variable' statement auto generation
  1. Assign1.png

Initialization of the third Assign Element(element name: 'Assign2')

The same set of actions as for first assign elements. But with different variables section:

  • From PaymentProcessing->response
  • To FlightBookingResponse->response
  • IMPORTANT: don't forget about additional initialization using 'Fixed Value to Variable' statement auto generation
  1. Assign2.png

The Process is Ready

Resulting artifacts are:

  • FlightBookingProcess.bpel
  • FlightBookingProcess.bpelex

Now those files ready for packaging and deployment.

Swordfish Documentation Home
Swordfish Wiki Home

Back to the top