www.codeguru.com/cpp/sample_chapter/article.php/c10789/

Back to Article

Home >> Visual C++ / C++ >> Sample Chapter


Oracle BPEL Process Manager
Rating:

Packt Publishing (view profile)
October 19, 2005

Go to page: Prev  1  2  3  4  5  6  7  8  9  10  11  12  13  Next

Process Descriptor

Each BPEL process we deploy to the Oracle BPEL Process Manager requires a process descriptor. This process descriptor is not covered by the BPEL standard and is specific to the BPEL server.


(continued)




The deployment process descriptor is the only part of the implementation of a process on a given platform that must be re-written to run the process on a different BPEL engine.

The Oracle process descriptor is an XML file specifying the following details about the BPEL process:

  1. BPEL source file name
  2. BPEL process name (ID)
  3. WSDL locations of all partner link web services
  4. Optional configuration properties

The default file name for the process descriptor is bpel.xml, but we can use any other name. Let us now write the process descriptor for our process. First we have to specify the XML header and the <BPELSuitcase> root element. In the <BPELProcess> element we specify two attributes, src, which denotes the BPEL source file name (Travel.bpel), and ID (id), which denotes BPEL process name as shown in the BPEL Console (we will use the TravelProcessCh4 ID):

<?xml version="1.0" encoding="UTF-8"?>
<BPELSuitcase>
   <BPELProcess src="Travel.bpel" id="TravelProcessCh4">
   ...

Next we specify the partner link binding properties for the location of the WSDL for each partner link that we use in the process. In our travel example process we use the following partner links:

  • client: Used for client interaction with the process
  • employeeTravelStatus: The link to the Employee web service
  • AmericanAirlines: The link to the American Airline web service
  • DeltaAirlines: The link to the Delta Airline web service
  • The WSDL for the client partner link is stored locally in the Travel.wsdl file. For the location of the other three partner web services' WSDLs, we have to specify the corresponding URLs. Here we have provided simplified implementations of all three web services, which can also be downloaded and deployed on the Oracle BPEL Server. The rest of the process descriptor with the location of the WSDLs is shown below:

    ...
       <partnerLinkBindings>
          <partnerLinkBinding name="client">
             <property name="wsdlLocation">
                Travel.wsdl
             </property>
          </partnerLinkBinding>
    
          <partnerLinkBinding name="employeeTravelStatus">
             <property name="wsdlLocation">
                http://localhost:9700/orabpel/default/Employee/Employee?wsdl
             </property>
          </partnerLinkBinding>
    
          <partnerLinkBinding name="AmericanAirlines">
             <property name="wsdlLocation">
                http://localhost:9700/orabpel/default/AmericanAirline/
                       AmericanAirline?wsdl
             </property>
          </partnerLinkBinding>
    
          <partnerLinkBinding name="DeltaAirlines">
             <property name="wsdlLocation">
                http://localhost:9700/orabpel/default/DeltaAirline/
                       DeltaAirline?wsdl
             </property>
          </partnerLinkBinding>
       </partnerLinkBindings>
    ...
    

    Optionally we can add configuration properties such as introduction text outputted by the BPEL Console when starting the process and default input data. The introduction text should be included within the <property> element with the attribute name set to testIntroduction:

    ...
       <configurations>
    
          <property name="testIntroduction">
             The Business Travel Process example.
          </property>
    ...
    

    To add the default input data (also optional) we have to define the <property> element with the name attribute set to defaultInput and provide the input XML message as CDATA:

    ...
             <property name="defaultInput">
                <![CDATA[
                   <TravelRequest xmlns="http://packtpub.com/bpel/
                                                travel/">
                      <employee xmlns="http://packtpub.com/service/
                                              employee/">
                         <FirstName>Matjaz B.</FirstName>
                         <LastName>Juric</LastName>
                         <Departement>University</Departement>
                      </employee>
                      <flightData xmlns="http://packtpub.com/service/
                                                airline/">
                         <OriginFrom>Ptuj</OriginFrom>
                         <DestinationTo>London</DestinationTo>
                         <DesiredDepartureDate>
                            2004-04-20
                         </DesiredDepartureDate>
                         <DesiredReturnDate>
                            2004-04-24
                         </DesiredReturnDate>
                      </flightData>
                  ;</TravelRequest>
                ]]>
             </property>
           </configurations>
        </BPELProcess>
    </BPELSuitcase>
    

    Setting the Environment

    We are now ready to start the BPEL Process Manager. We can do this from the Start menu (if using Windows) or by executing the startOraBPEL script, which can be found in the c:\orabpel\bin directory (assuming Oracle BPEL Process Manager has been installed in c:\orabpel). It is recommended that you include this directory in the path for easy access.

    Next we will need a command prompt where we have to set the environment variables. We can do this by executing the obsetenv script in the same c:\orabpel\bin directory. The script sets the following environment variables:

    • OB_HOME: Specifies the path to the Oracle BPEL installation directory (c:\orabpel is the default path)
    • OB_PLATFORM: Specifies the application server (oc4j_10g if using Oracle OC4J)
    • MY_CLASSPATH and MY_CLASSES_DIR: Specify the class path for Oracle BPEL Server
    • JAVA_HOME: Points to the Java SDK home directory
    • OB_JAVA_PROPERTIES: Specifies the WSDL factory and the options proxy settings
    • J2EE_APPLICATIONS: Specifies the application server directory where J2EE applications can be deployed

    Setting the environment variables is essential for successful deployment of BPEL processes.

    BPEL Compiler

    After we have written the process descriptor and set the environment we are ready to deploy the BPEL process. For this, Oracle BPEL Process Manager provides the BPEL Complier, which can be started with the bpelc command from the command line. bpelc compiles the BPEL process source files and creates the BPEL process archive JAR file. It can also automatically deploy the process to the Oracle BPEL Server. This is discussed in the next section.

    The BPEL compiler has the following syntax:

    > bpelc [options] process_descriptor_name.xml

    The default for process_descriptor_name.xml is bpel.xml. The most important options are:

    • -rev <revision_tag>: Specifies the revision (version) number for the deployed BPEL process
    • -force: Directs the compiler not to check the timestamps of the .bpel, .wsdl, and .xml files

    We can use the following command to generate the BPEL process JAR archive with the revision number 1.0 for our travel example:

    > bpelc .rev 1.0

    This command generates the bpel_TravelProcessCh4_1.0.jar archive file, as shown:


    (
    Full Size Image)

    The generated archive includes the BPEL source and the related WSDL and XML files. It also includes the process model file (in our example called TravelModel.xml) which is a normalized BPEL representation with an added id for each activity.

    Deployment and Domains

    We have several options to deploy our travel process:

    • Copy the BPEL archive to the server domain manually
    • Use bpelc to deploy the process
    • Use the obant utility to do the deployment
    • Use the BPEL Console to deploy the BPEL process archive

    Before we deploy, let's discus the Oracle BPEL Server architecture. Each Oracle BPEL Server installation can be logically partitioned into several domains. The default domain is created automatically by the installation (called default). Additional domains can be created using BPEL Console; this is discussed later in the chapter. The domains are located in the c:\orabpel\domains directory.

    To manually deploy a BPEL process we simply copy the JAR archive to the corresponding directory. In our case this is c:\orabpel\domains\default\deploy. The BPEL Server will automatically pick up the process.

    Using bpelc to deploy the process requires us to use the -deploy <domain_id> option, which directs the compiler to automatically deploy the archive to the specified domain.

    The domain to which the deployment is done must be accessible via the file system. To deploy our travel example using bpelc we need to use the following command:

    > bpelc .rev 1.0 .deploy default

    The following screenshot shows the output:


    (Full Size Image)

    Go to page: Prev  1  2  3  4  5  6  7  8  9  10  11  12  13  Next

    Tools:
    Add www.codeguru.com to your favorites
    Add www.codeguru.com to your browser search box
    IE 7 | Firefox 2.0 | Firefox 1.5.x
    Receive news via our XML/RSS feed






    internet.commediabistro.comJusttechjobs.comGraphics.com

    Search:

    WebMediaBrands Corporate Info

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | Shopping | E-mail Offers