Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Swordfish Documentation: Service Orchestration

Service Orchestration

This topic shows you how to create, run and deploy a BPEL process using Swordfish and ODE.

Creating and Running a BPEL Process

For more information on creating a BPEL process with the Eclipse BPEL Designer, see Creating BPEL Skeleton Process.

To create and run a BPEL process:

  1. Go to the SOPERA update site http://soaswordfishdemo.googlecode.com/svn/trunk/org.eclipse.sowrdfish.soademo.site.builder/ and install Eclipse BPEL Designer.
  2. Install ODE
    1. Go to Eclipse Menu, Eclipse - Preferences - Plug-in Development - Target Platform. Select Swordfish Target platform and click "Edit".
    2. Click "Add", select "Software Site" and press "Next". Use "http://soaswordfishdemo.googlecode.com/svn/trunk/SOADemoSite/" Update site and install "Swordfish ODE Integration".
    3. Press Finish.
  3. Create a target platform provisioning tool. Include Swordfish runtime and ODE.
  4. Create a new BPEL process project (for the Flight Booking use case scenario)
    1. Design your BPEL process by dragging process element icons from the context menu and dropping it onto the design pane.
    2. For each step you create, define a corresponding partner link
    3. Deploy the generated ODE artifacts into the Swordfish (see section How to deploy ODE artifacts into the Swordfish)
  5. Start the BPEL process by invoking it from the Web Service Explorer


Deploying the ODE artifacts into the Swordfish

We anticipate that the Swordfish Tooling will automate all the steps described here in the near future.

Prerequisites

  • The BPEL process file has been created
  • WSDL files for all the partner links
  • ODE deploy.xml http://ode.apache.org/deployxml.html http://ode.apache.org/jbi-deployment.html
  • Deploying ODE Artifacts

    To deploy the ODE artifacts:
    (NOTE: For deployment we will use spring osgi packaging. This means that some bundle or eclipse plug-in needs to embed the spring XML descriptor, that will be initialized when the OSGI environment starts http://static.springsource.org/osgi/docs/1.2.0/reference/html-single/#bnd-app-ctx )

    1. Move all the artifacts listed in the "Prerequisites" section to the dedicated directory. Let us name the directory. "ode_artifacts_directory". It should contain the following files: *.bpel(BPEL process files), *.wsdl (WSDL files for the patner links), deploy.xml(ODE deployment descriptor)
    2. For the Flight Reservation Tutorial the deploy.xml file should look like this:
      <deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
      	xmlns:process="http://www.eclipse.org/swordfish/samples/FlightBookingProcess"
      	xmlns:booking="http://www.eclipse.org/swordfish/samples/FlightBooking/"
      	xmlns:reservation="http://www.eclipse.org/swordfish/samples/FlightReservation/"
      	xmlns:payment="http://www.eclipse.org/swordfish/samples/PaymentProcessing/">
      	<process name="process:FlightBookingProcess">
      		<active>true</active>
      		<in-memory>true</in-memory>
      		<process-events generate="none" />
      		<provide partnerLink="FlightBooking">
      			<service
      				name="booking:FlightBookingService"
      				port="FlightBookingSOAP" />
      		</provide>
      		<invoke partnerLink="FlightReservation">
      			<service
      				name="reservation:FlightReservationService"
      				port="FlightReservationSOAP" />
      		</invoke>
      		<invoke partnerLink="PaymentProcessing">
      			<service
      				name="payment:PaymentProcessingService"
      				port="PaymentProcessingSOAP" />
      		</invoke>
      	</process>
      </deploy>
    3. Deploy the ODE artifacts into Swordfish. To do this, efine org.eclipse.swordfish.plugins.ode.support.BpelArtifactExporter spring bean along with the reference to ode_artifacts_directory in the spring osgi xml descriptor
          
          <bean id="bpelArtifactExporter" 
              class="org.eclipse.swordfish.plugins.ode.support.BpelArtifactExporter"
              p:bpelArtifactDirectory="classpath:ode_artifacts_directory/"/> 
      
      
    4. Also we need to deploy inbound and outbound http endpoints for the partner links
      To be able to invoke the bpel process outside the nmr, we need to declare an outbound http endpoint:
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:http="http://servicemix.apache.org/http/1.0"       
             xmlns:osgi="http://www.springframework.org/schema/osgi"
             xmlns:swordfishCxf="http://cxf.samples.swordfish.eclipse.org/"       
             xmlns:paymentProcessing="http://www.eclipse.org/swordfish/samples/PaymentProcessing/"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:flightReservation="http://www.eclipse.org/swordfish/samples/FlightReservation/"
             xmlns:flightBooking="http://www.eclipse.org/swordfish/samples/FlightBooking/"
             xsi:schemaLocation="
      	 http://www.springframework.org/schema/beans
      	 http://www.springframework.org/schema/beans/spring-beans.xsd
      	 http://www.springframework.org/schema/osgi
      	 http://www.springframework.org/schema/osgi/spring-osgi.xsd
      	 http://servicemix.apache.org/http/1.0
      	 http://servicemix.apache.org/http/1.0/servicemix-http.xsd">  
      	<bean class="org.apache.servicemix.common.osgi.EndpointExporter" />  
        	
          
          <http:endpoint                  
                       endpoint="FlightBookingSOAP"                 
                       service="flightBooking:FlightBookingService"                 
                       soap="true"
                       role="consumer"                 
                       defaultMep="http://www.w3.org/2004/08/wsdl/in-out" 
                       locationURI="http://localhost:8198/FlightBooking_Service/"
                       wsdlResource="classpath:ode_artifacts_directory/FlightBooking.wsdl"/>
      

      The FlightBooking BPEL process uses the FlightReservation and the PaymentProcessing partner links. We need to specify outbound http endpoints for them:

         <http:endpoint                  
                       endpoint="FlightReservationSOAP"                 
                       service="flightReservation:FlightReservationService"                 
                       soap="true"
                       role="provider"                 
                       defaultMep="http://www.w3.org/2004/08/wsdl/in-out" 
                       locationURI="http://localhost:8197/FlightReservation_Service/"
                       wsdlResource="classpath:ode_artifacts_directory/FlightBooking.wsdl"/>              
         <http:endpoint                  
                       endpoint="PaymentProcessingSOAP"                 
                       service="paymentProcessing:PaymentProcessingService"                 
                       soap="true"
                       role="provider"                 
                       defaultMep="http://www.w3.org/2004/08/wsdl/in-out" 
                       locationURI="http://localhost:8197/PaymentProcessing_Service/"
                       wsdlResource="classpath:ode_artifacts_directory/PaymentProcessing.wsdl"/>
          

    Swordfish Documentation Home

    Swordfish Wiki Home

Back to the top