Oracle® SOA Suite Developer's Guide 10g (10.1.3.1.0) Part Number B28764-01 |
|
|
View PDF |
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.
bpel_process_name
.bpel
A BPEL source file that contains the basic, required activities for a BPEL process. You build on this file when you drag and drop activities and services, create variables and partner links, and so on, in Oracle JDeveloper.
bpel_process_name
.xsd
An XML schema for validating the XML documents involved in the process. Custom XSD files that you create when you create a BPEL process or that you import appear in the same location as this file.
bpel_process_name
.wsdl
A basic WSDL for building the communication endpoints for a web service.
bpel.xml
The deployment description file that defines the locations of the WSDL files for web services that are called by the BPEL process. The file references the public interface for the web service.
Figure 7-2 shows these files for a BPEL project named BPELProcess1_synch.
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:
application_name
.jws
The Java application file. For a complex business process, the application contains a number of projects (.jpr
files).
bpel_process_name
.jpr
The Java project file. Each .jpr
file is associated with a .bpel
file with the same name.
Create a BPEL process by first creating an application in Oracle JDeveloper.
To create an application:
In the Application Navigator, right-click Applications and choose New Application.
Use the Create Application dialog to enter the name and location for the new application and to specify the application template.
Enter an application name.
Enter or browse for a directory name, or accept the default.
Enter an application package prefix.
The prefix, followed by a period, applies to objects created in the initial project of an application.
For a BPEL project, select No Template [All Technologies] for an application template.
Click OK.
In the Create Project window, click Cancel.
After creating an application in Oracle JDeveloper, you create one or more BPEL projects within the application.
To create a BPEL project:
Right-click the application name you just created and choose New Project.
Under Categories, expand General and select Projects.
Under Items, select BPEL Process Project and click OK.
Use the BPEL Project Creation Wizard - Project Settings dialog to set up the BPEL project.
Enter a name for the BPEL process.
Enter a namespace or accept the default.
Use the default project settings or specify your own.
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.
Click Next.
Use the BPEL Project Creation Wizard - Input/Output Elements dialog to add your own schema files or accept the default schema files.
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
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
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.