Developer Guide to the BPEL Designer: The BPEL Module Project
Contributed by Bob May, maintained by Irina Filippova
December 2007
Contents
Developer Guide to the BPEL Designer
Understanding the BPEL Module Project
The BPEL Module project is a group of source files which includes BPEL files, WSDL files, and XML schema files. Within a BPEL Module project, you can author a business process compliant with the WS-BPEL 2.0 language specification.
The BPEL Module project provides point-and-click support for the following:
-
Using the New Project wizard to create a BPEL Module project and a Composite Application project.
-
Importing WSDL Resources to act as partner services in the business process.
-
Creating new WSDL resources, as needed.
-
Importing XML Schema resources.
-
Adding BPEL activities to the business process diagram; further defining the elements by using Property Editor dialog boxes, Properties windiw, and pop-up menu actions.
-
Adding to the source code of the BPEL, WSDL and XSD files.
-
Checking and validating XML source code.
-
Building and adding the project as a JBI module to a Composite Application project.
-
Test running BPEL processes by sending sample messages to the deployed process or processes.
-
Debugging deployed business processes
Accordingly, the typical procedure to follow when building a BPEL process is:
-
Create a BPEL Module project using
the New Project wizard.
-
Create a Composite Application project.
For sample processes, Composite Application projects are created automatically for you.
For the processes created from scratch, you should create the Composite Application project manually.
-
Add the BPEL Module as a JBI Module to the Composite Application project.
-
(Optional) Build the Composite Application project and make sure that the Application Server is started.
-
Deploy the Composite Application project
to the BPEL Service Engine.
-
Create test cases.
For sample processes, test cases are automatically created; for new projects, you need to create at least one test case.
-
Run one or all test cases.
- (Optional) Debug the BPEL process.
top
Creating a BPEL Module Project
To create a BPEL Module project:
-
In the IDE, choose File > New Project from the main menu and then perform the following steps:
-
Under Categories, select SOA.
-
Under Projects, select BPEL Module and click Next.
- In the Name and Location page, enter the project name and specify the project location or accept the defaults.
-
Click Finish.
The Projects window now contains a project node for the BPEL Module project.
-
To create a BPEL file for your project, right-click the Process Files node and choose New > BPEL Process from the pop-up menu.
-
In the New BPEL Process dialog box, specify the file name and folder. Click Finish.
-
To create a WSDL file for your project, right-click the Process Files node and choose New > WSDL Document from the pop-up menu.
-
In the New WSDL Document dialog box, specify the file name and folder. Optionally, select the Import XML Schema File(s) checkbox and browse for a Schema file to import. Click Finish.
Exploring the BPEL Module Project in the Projects Window
A typical BPEL Module project contains a BPEL source file, WSDL and XSD files.
Take a look at the artifacts you have created:
-
In the Projects window, expand the created BPELModule1 node and the Process Files node.
The Process Files node contains these items:
-
newProcess.bpel, the BPEL process
-
newWSDL.wsdl, the process web service interface.
-
Double-click the newProcess.bpel node.
Notice the following:
- The newProcess.bpel diagram opens in the Design view.
The Design view is the area where you can visually model business processes. The BPEL Designer automatically generates BPEL code that corresponds to the visual design.
- The Source view for newProcess.bpel can be invoked by clicking the Source button.
- The Palette of BPEL elements opens in the Design view to the right of the design area.
-
The Properties window opens for a selected element below the Palette.
-
The Navigator window shows the BPEL Logical View of the BPEL process.
-
The BPEL Mapper window appears in the bottom (if it does not appear automatically, choose Window > Other > BPEL Mapper from the main menu).
![BPEL File Open](../../../images/articles/ep-bpel-guide/60/exploringbpel_tn.png)
Click to enlarge
-
Double-clicking the newWSDL.wsdl node opens the WSDL Editor where you can view and modify your newWSDL.wsdl file.
Properties of a BPEL Module Project
You open the Properties dialog box for a BPEL Module project by right-clicking the BPEL Module project's node and choosing Properties. The tree in the left pane shows that you have access to three pages:
-
General
- Project References
- XML Catalog
The General page allows you to view the path to the folder containing the project's files and view or modify the prefix for the project service engine (such as com.sun.bpelse).
The Project References page displays other BPEL Module projects that are referenced by your BPEL Module project. In this page, you can add and remove projects referenced by the BPEL Module project.
The XML Catalog page displays XML catalog entries used within your BPEL Module project. XML catalogs provide mapping information that maps an external entity in an XML document to the actual location of the document being referenced. In this page, you can remove XML catalog entries from the list of XML catalogs for your BPEL Module project.
top
Creating a Composite Application Project
A BPEL Module project is not directly deployable. You must first add a BPEL Module project, as a JBI module, to a Composite Application project. You can then deploy the Composite Application project. Deploying the project makes the service assembly available to the application server, thus allowing its service units to run.
Creating Composite Application Projects
The New Project wizard guides you through the steps needed to create a Composite Application project.
To create a new Composite Application project:
-
Choose File > New Project (Ctrl-Shift-N).
-
In the Categories list, select SOA and in the Projects list, select Composite Application and click Next.
-
In the Name and Location page, name the project and specify the location of project files.
-
To set the new Composite Application project as main, leave the Set as Main Project checkbox selected.
-
Click Finish.
The new Composite Application project appears in the Projects window. In order to deploy and perform test runs of your business process, add the BPEL Module as a JBI module to the Composite Application project.
Building a BPEL Module Project
When you build a project, the IDE compiles the BPEL source file and packages the BPEL file and web service artifacts, including WSDL and XSD files, into a JAR archive. You should add this project JAR file to a Composite Application project and then deploy it to the JBI server.
Follow this procedure to build a BPEL Module project:
-
In the Projects window, right-click the BPEL Module project's node and choose Build Project.
You can also perform a clean build by right-clicking the BPEL Module project's node in the Projects window and choosing Clean and Build Project.
-
Watch for the BUILD SUCCESSFUL message in the Output window.
Adding JBI Modules to Composite Application Projects
To add a JBI module to the Composite Application project:
-
In the Projects window, right-click the Composite Application project's node and choose Add JBI Module.
-
In the Select Project dialog box, select the BPEL Module project folder, make sure that the project's JAR file has appeared in the Project JAR Files list, and click Add Project JAR Files.
To verify that the BPEL Module has been added as a JBI Module, in the Projects window, expand Composite Application project > JBI Modules. You should see the JAR file of the BPEL Module project.
top
Deploying a Composite Application Project
The Deploy action compiles the files in the Composite Application project, packages the compiled BPEL and related web service artifacts (including WSDL and XSD files) into an archive, and deploys them to the Application Server.
To deploy a Composite Application Project:
-
Right-click the Composite Application project's node, and choose Deploy Project.
-
In the Warning dialog box, make sure the GlassFish V2 is selected and click OK.
-
Deployment has succeeded if you see the Build successful message in the Output window.
If the Output window is not visible, choose Window > Output > Output.
-
Open the Services window and expand Servers > GlassFish V2> JBI > Service Assemblies to see the deployed Service Assembly.
If you do not see the deployed project, right-click the Service Assemblies node and choose Refresh.
top
Creating Sample Processes in the BPEL Designer
The best way to get acquainted with constructing BPEL diagrams is to create sample processes. You can design your BPEL process by modifying existing sample processes.
For samples, the New Project sample wizard automatically generates both types of projects, BPEL Module and Composite Application, so you do not need to separately create each of these projects. The IDE automatically adds the sample BPEL Module project as a JBI module to the Composite Application project.
In the BPEL Designer, you can create the following sample processes:
A Synchronous Sample Process
A synchronous process refers to a conversation style in which the client sends a message to the process, waits for a reply, and continues work only when the reply comes back. When you create a synchronous sample process, the IDE generates a skeletal process with a single synchronous operation and the required WSDL and XML schema files.
An Asynchronous Sample Process
An asynchronous process applies to long-running conversations in which the client does not wait for a reply from the process before continuing its work. Instead of returning the result synchronously to the client, this process accepts the client's request, performs work that might be long-running, and then asynchronously calls back to the client when the work is done. When you create an asynchronous process, the IDE generates a skeletal process with one incoming and one outgoing asynchronous operation and the required WSDL and XML schema files.
Note that any particular process can consist of an arbitrary collection of synchronous and asynchronous interactions with one or more conversational partners.
Travel Reservation Service Sample
This sample is a real-world BPEL process sample constructed using the majority of BPEL elements and several partner web services.
Together with the Travel Reservation Service sample, the wizard creates another project, Reservation Partner Services, a basic EJB and JMS based implementation of the three partner services.
Creating a Sample BPEL Module Project: General Flow
To create a sample BPEL Module project:
-
Choose File > New Project (Ctrl-Shift-N).
-
In the Categories list, expand the Samples node and select SOA.
-
In the Projects list, select the sample project you want to create and click Next.
-
In the Name and Location page, name the project and specify the location of project files.
-
Click Finish.
The wizard creates two types of projects for the selected sample: a sample BPEL Module project and a sample Composite Application project. You are free to modify the sample business process and or add additional BPEL processes to the BPEL Module. To deploy, test-run, and debug the BPEL process, use the Composite Application project.
top