Skip Headers
Oracle® SOA Suite Developer's Guide
10g (10.1.3.1.0)

Part Number B28764-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

7.2 Creating an Application and a BPEL Project

When creating a BPEL process, the first step is to create an application and a BPEL project in Oracle JDeveloper. The following files are generated when you do so.

Figure 7-2 shows these files for a BPEL project named BPELProcess1_synch.

Figure 7-2 BPEL Project Files Created in Oracle JDeveloper

Description of Figure 7-2 follows
Description of "Figure 7-2 BPEL Project Files Created in Oracle JDeveloper"

In addition to the files shown in Figure 7-2, the following are also created:

7.2.1 How to Create an Application

Create a BPEL process by first creating an application in Oracle JDeveloper.

To create an application:

  1. In the Application Navigator, right-click Applications and choose New Application.

  2. Use the Create Application dialog to enter the name and location for the new application and to specify the application template.

    1. Enter an application name.

    2. Enter or browse for a directory name, or accept the default.

    3. Enter an application package prefix.

      The prefix, followed by a period, applies to objects created in the initial project of an application.

    4. For a BPEL project, select No Template [All Technologies] for an application template.

    5. Click OK.

  3. In the Create Project window, click Cancel.

7.2.2 How to Create a BPEL Project

After creating an application in Oracle JDeveloper, you create one or more BPEL projects within the application.

To create a BPEL project:

  1. Right-click the application name you just created and choose New Project.

  2. Under Categories, expand General and select Projects.

  3. Under Items, select BPEL Process Project and click OK.

  4. Use the BPEL Project Creation Wizard - Project Settings dialog to set up the BPEL project.

    1. Enter a name for the BPEL process.

    2. Enter a namespace or accept the default.

    3. Use the default project settings or specify your own.

    4. Select a template for one of the following:

      Asynchronous BPEL process: Creates an asynchronous process with a default receive activity to initiate the BPEL process flow and an invoke activity to asynchronously call back the client.

      Synchronous BPEL process: Creates a synchronous process with a default receive activity to initiate the BPEL process flow and a reply activity to return the results.

      Empty BPEL process: Creates an empty process with no activities.

    5. Click Next.

  5. Use the BPEL Project Creation Wizard - Input/Output Elements dialog to add your own schema files or accept the default schema files.

7.2.3 What Happens When You Create an Application and a BPEL Project

After you create a BPEL project, the skeleton BPEL process appears in the Oracle JDeveloper diagram view, as shown in Figure 7-3. This is the workflow represented by the bpel_process_name.bpel file.

Figure 7-3 shows a synchronous BPEL process. The receive activity, labeled receiveInput, is used for the input variable, and the reply activity, labeled replyOutput, is used for the output variable.

Figure 7-3 BPEL Diagram for a Synchronous Process

Description of Figure 7-3 follows
Description of "Figure 7-3 BPEL Diagram for a Synchronous Process"

Figure 7-4 shows an asynchronous process. The receive activity, labeled receiveInput, is used for the input variable, and the invoke activity, labeled callBackClient, is used for the output variable and to invoke the web service.

Figure 7-4 BPEL Diagram for an Asynchronous Process

Description of Figure 7-4 follows
Description of "Figure 7-4 BPEL Diagram for an Asynchronous Process"

You can view the BPEL source code corresponding to the diagram view from the Source tab below the diagram.

Example 7-1 shows the source code for an asynchronous process.

Example 7-1 Source Code for an Asynchronous Process

<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
///////////////////////////////////////////////////////////////////////////////////////////////////
  Oracle JDeveloper BPEL Designer 
  Created: Wed May 03 10:14:38 PDT 2006
  Author: 
  Purpose: Asynchronous BPEL Process
///////////////////////////////////////////////////////////////////////////////////////////////////
-->
<process name="BPELProcess1_asynch"
         targetNamespace="http://xmlns.oracle.com/BPELProcess1_asynch"
         xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
         xmlns:xp20="http://www.oracle.com/XSL/Transform/java/
           oracle.tip.pc.services.functions.Xpath20"
         xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
         xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:client="http://xmlns.oracle.com/BPELProcess1_asynch"
         xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
         xmlns:ora="http://schemas.oracle.com/xpath/extension"
         xmlns:orcl="http://www.oracle.com/XSL/Transform/java/
           oracle.tip.pc.services.functions.ExtFunc">
    <!-- 
      ///////////////////////////////////////////////////////////////////////////////////////////////////
        PARTNERLINKS
        List of services participating in this BPEL process
///////////////////////////////////////////////////////////////////////////////////////////////////
    -->
    <partnerLinks>
        <!-- 
      The 'client' role represents the requester of this service. It is 
      used for callback. The location and correlation information associated
      with the client role are automatically set using WS-Addressing.
    -->
        <partnerLink name="client" partnerLinkType="client:BPELProcess1_asynch"
                     myRole="BPELProcess1_asynchProvider"
                     partnerRole="BPELProcess1_asynchRequester"/>
    </partnerLinks>
    <!--
  ///////////////////////////////////////////////////////////////////////////////////////////////////
        VARIABLES
        List of messages and XML documents used within this BPEL process
 ///////////////////////////////////////////////////////////////////////////////////////////////////
    -->
    <variables>
        <!-- Reference to the message passed as input during initiation -->
        <variable name="inputVariable"
                  messageType="client:BPELProcess1_asynchRequestMessage"/>
        <!-- Reference to the message that will be sent back to the requester during callback -->
        <variable name="outputVariable"
                  messageType="client:BPELProcess1_asynchResponseMessage"/>
    </variables>
    <!-- 
      ///////////////////////////////////////////////////////////////////////////////////////////////////
       ORCHESTRATION LOGIC                                               
       Set of activities coordinating the flow of messages across the    
       services integrated within this business process                  
      ///////////////////////////////////////////////////////////////////////////////////////////////////
    -->
    <sequence name="main">
        <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1_asynch.wsdl) -->
        <receive name="receiveInput" partnerLink="client"
                 portType="client:BPELProcess1_asynch" operation="initiate"
                 variable="inputVariable" createInstance="yes"/>
        <!-- 
          Asynchronous callback to the requester. (The callback location and correlation id are
          transparently handled using WS-addressing.)
        -->
        <invoke name="callbackClient" partnerLink="client"
                portType="client:BPELProcess1_asynchCallback"
                operation="onResult" inputVariable="outputVariable"/>
    </sequence>
</process>

See Oracle BPEL Process Manager Quick Start Guide for more information about the source code for an asynchronous process.