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

Difference between revisions of "Swordfish Documentation: Designing BPEL Eclipse BPEL Designer"

(Setting Up BPEL WSIL Browser)
(Creating Receive-InBound Partner Link)
Line 29: Line 29:
 
=== Creating Receive-InBound Partner Link ===
 
=== Creating Receive-InBound Partner Link ===
  
# click on the "Receive" element on the BPEL diagram. Open the'''Properties''' view and click the '''Details''' tab. You should see an empty '''Partner Link''' and '''Operation Fields'''. Expand the Partner Link drop down list and choose  the'''Create Global Partner Link''' item:
+
# Click on the '''Receive''' element in the BPEL diagram. Open the'''Properties''' view and click the '''Details''' tab. You should see an empty '''Partner Link''' and '''Operation Fields''' item. Expand the Partner Link drop down list and choose  the'''Create Global Partner Link''' item:
 
#:[[Image:Parnter-link-field.png]]
 
#:[[Image:Parnter-link-field.png]]
# In the '''New Parner Link''' window, type ''FlightBooking'' name.  
+
# In the '''New Parner Link''' window, type ''FlightBooking''.  
 
# In the next window, the option <b>Choose Partner Link Type</b> will be empty by default. To see the available types we need to import the corresponding WSDL files. Click on '''Add WSDL'''.
 
# In the next window, the option <b>Choose Partner Link Type</b> will be empty by default. To see the available types we need to import the corresponding WSDL files. Click on '''Add WSDL'''.
 
#: [[Image:Empty-choose-partner-link-window.png]]
 
#: [[Image:Empty-choose-partner-link-window.png]]
# In the '''Browse for a WSDL to Import''' check the WSIL button and if your Swordfish Registry is up and running, and the BPEL WSIL Browser is set up correctly, you should see the Inspection tree including 3 WSDL files. For this step you need to click on 'FlightBooking.wsdl' and click <b>OK</b>.
+
# In the '''Browse for a WSDL to Import''' check the WSIL button. If your Swordfish Registry is up and running, and the BPEL WSIL Browser is set up correctly, you should see the Inspection tree including all 3 WSDL files. For this step you need to click on 'FlightBooking.wsdl' and click <b>OK</b>.
 
#:[[Image:Choose-flight-booking-wsdl.png]]
 
#:[[Image:Choose-flight-booking-wsdl.png]]
# repeat previous step form 'FlightReservation.wsdl' and 'PaymentProcessing.wsdl' files.
+
# Repeat the previous step for the 'FlightReservation.wsdl' and 'PaymentProcessing.wsdl' files.
# now your '''New Parner Link''' windows should looks like on image below, click on 'FlightBooking' item from '''Matches''' area and click OK.
+
# Now your '''New Parner Link''' windows should look similar to the image shown here.
 +
# Click the 'FlightBooking' item in the'''Matches''' area and click '''OK'''.
 
#: [[Image:Choose-partner-link-fool.png]]
 
#: [[Image:Choose-partner-link-fool.png]]
# 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
+
# In the next window set '''Partner Link Type Name''' with the same value as '''Partner Link Name''': 'FlightBooking'.  
# in the next window enter 'InBound' for '''Role Name''' field and select FlightBooking port type from list below(see image). Press Finish.
+
# Click on to go to next step of partner link type creation
 +
# In the next window, enter 'InBound' for the '''Role Name''' field and select FlightBooking port type from list below(see image).  
 +
#  Click '''Finish'''.
 
#: [[Image:Create-parther-link-type.png]]
 
#: [[Image:Create-parther-link-type.png]]
# leave '''Set Namespace Prefix''' window fields as it is.  
+
# Leave the options in the'''Set Namespace Prefix''' window fields as it is.  
# After partner link creating finished get back to BPEL diagram and check changes:
+
# After you finish creating partner link go back to BPEL diagram and check your changes:
## new Partner Link 'FlightBooking' now visible on BPEL process sidebar
+
## new Partner Link 'FlightBooking' is now visible in BPEL process side bar
## in properties pane for 'Receive' element '''Partner Link''' should become initialized with just created partner link name.
+
## In the properties pane 'Receive' element '''Partner Link''' should become initialized with just the created partner link name.
## in properties pane for 'Receive' element '''Operation''' link still empty.
+
## In the properties pane for 'Receive' element, '''Operation''' link is still empty.
 
#:[[Image:Properties-and-new-partner-link.png]]
 
#:[[Image:Properties-and-new-partner-link.png]]
# 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:
+
# We still need to set '''Operation''' field for 'Receive' element. The easiest way do to this is to click on the '''flightBooking''' operation icon within the'''Quick Pick''' element tree. Now, you can also see that the new process variable 'FlightBookingRequest' has been automatically created and assigned to a current partner link:
 
#:[[Image:Set-operation-and-new-variable.png]]
 
#:[[Image:Set-operation-and-new-variable.png]]
  

Revision as of 09:33, 17 August 2009

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 by selecting 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 clicking it. You can now see a visual representation of an empty BPEL process as shown in this figure.
    Empty-bpel.png
  4. Expand the BPEL elements palette by clicking the arrow icon highlighted in this figure:
    Bpel-element-palette.png
  5. Using the Element Palette, create an initial BPEL Process Skeleton as displayed in this image:
    Bpel-process-skeleton.png

Setting Up BPEL WSIL Browser

To create a Partner Link to an external Web service and expose the BPEL process as a Web service we need a set of corresponding WSDL files. In the current tutorial, those files can be accessed from the Swordfish Registry.

  1. Start Swordfish Service Registry, [download]) and install the 3 WSDL files:FlightBooking.wsdl, FlightReservation.wsdl, and PaymentProcessing.wsdl. The Service Registry automatically provides a WSIL file for the installed WSDLs. The default URL is http://localhost:9001/registry/wsil, as shown in this figure.
    Wsil.png
  2. In order to access and import the above mentioned WSDL files initialize BPEL WSIL Browser. To do this select Preference > BPEL > WSIL Brower and set "Document URL" field as http://localhost:9001/registry/wsil.
  3. Click OK.
    Init-wsil-browser.png
  4. IMPORTANT: Service Registry should be up and running in the next phase, that is, the design and process execution phase.

Creating Partner Links

In the newly created process diagram we have one receive-type element (with same name "Receive") and two invoke-type elements ("processReservation" and "paimentProcessing"). For the Receive-type element we need InBound endpoints and for the invoke-type we need to create OutBound endpoints. To create Partner Links we need to import the corresponding WSDL file to the BPEL process.

Creating Receive-InBound Partner Link

  1. Click on the Receive element in the BPEL diagram. Open theProperties view and click the Details tab. You should see an empty Partner Link and Operation Fields item. Expand the Partner Link drop down list and choose theCreate Global Partner Link item:
    Parnter-link-field.png
  2. In the New Parner Link window, type FlightBooking.
  3. In the next window, the option Choose Partner Link Type will be empty by default. To see the available types we need to import the corresponding WSDL files. Click on Add WSDL.
    Empty-choose-partner-link-window.png
  4. In the Browse for a WSDL to Import check the WSIL button. If your Swordfish Registry is up and running, and the BPEL WSIL Browser is set up correctly, you should see the Inspection tree including all 3 WSDL files. For this step you need to click on 'FlightBooking.wsdl' and click OK.
    Choose-flight-booking-wsdl.png
  5. Repeat the previous step for the 'FlightReservation.wsdl' and 'PaymentProcessing.wsdl' files.
  6. Now your New Parner Link windows should look similar to the image shown here.
  7. Click the 'FlightBooking' item in theMatches area and click OK.
    Choose-partner-link-fool.png
  8. In the next window set Partner Link Type Name with the same value as Partner Link Name: 'FlightBooking'.
  9. Click on to go to next step of partner link type creation
  10. In the next window, enter 'InBound' for the Role Name field and select FlightBooking port type from list below(see image).
  11. Click Finish.
    Create-parther-link-type.png
  12. Leave the options in theSet Namespace Prefix window fields as it is.
  13. After you finish creating partner link go back to BPEL diagram and check your changes:
    1. new Partner Link 'FlightBooking' is now visible in BPEL process side bar
    2. In the properties pane 'Receive' element Partner Link should become initialized with just the created partner link name.
    3. In the properties pane for 'Receive' element, Operation link is still empty.
    Properties-and-new-partner-link.png
  14. We still need to set Operation field for 'Receive' element. The easiest way do to this is to click on the flightBooking operation icon within theQuick Pick element tree. Now, you can also see that the new process variable 'FlightBookingRequest' has been automatically created and assigned to a current partner link:
    Set-operation-and-new-variable.png

Creating flightReservation OutBound Partner Link

Select flightReservation 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 'FlightReservation'
  • Partner Link Role Name should be setted as 'OutBound'
  • Operation name for FlightReservation 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.

Note:

  • Partner Link Name and Partner Link Type Name should be 'PaymentProcessing'
  • The Partner Link Type Role Name should be set to 'OutBound'
  • The 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.

NOTE: After you set the operation value, a new variable 'FlightBookingResponse' should be 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')

Now you need to do the same set of actions as for first assign elements. However, there are different variables to be used in this section:

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

NOTE: You can now use this process.

The 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