Developer Guide to the BPEL Designer

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:

Accordingly, the typical procedure to follow when building a BPEL process is:

  1. Creating a new BPEL Module Project using the New Project wizard.

  2. Creating 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.

  3. Adding JBI Modules to Composite Application Projects to the Composite Application project.

  4. (Optional) Build the Composite Application project and make sure that the Application Server is started.

  5. Deploying a Composite Application Project the Composite Application project to the BPEL Service Engine.

  6. Create test cases.

    For sample processes, test cases are automatically created; for new projects, you need to create at least one test case.

  7. Run one or all test cases.

  8. (Optional) Debug the BPEL process.

Creating a new BPEL Module Project

ProcedureTo create a BPEL Module project:

  1. In the IDE, choose File > New Project from the main menu and then perform the following steps:

    1. Under Categories, select SOA.

    2. Under Projects, select BPEL Module and click Next.

      New Project. Step 1
  2. In the Name and Location page, enter the project name and specify the project location or accept the defaults.

  3. Click Finish.

    New Project. Step 2

    The Projects window now contains a project node for the BPEL Module project.

    New BPEL Module
  4. To create a BPEL file for your project, right-click the Process Files node and choose New > BPEL Process from the pop-up menu.

  5. In the New BPEL Process dialog box, specify the file name and folder. Click Finish.

    New BPEL Process wizard
  6. To create a WSDL file for your project, right-click the Process Files node and choose New > WSDL Document from the pop-up menu.

  7. 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.

    New WSDL Document wizard

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:

  1. 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.

    BPEL Module process files
  2. 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).

    New BPEL Process diagram
  3. Double-clicking the newWSDL.wsdl node opens the WSDL Editor where you can view and modify your newWSDL.wsdl file. For more information see Working with WSDL Files

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:

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.

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.

ProcedureTo create a new Composite Application project:

  1. Choose File > New Project (Ctrl-Shift-N).

  2. In the Categories list, select SOA and in the Projects list, select Composite Application and click Next.

  3. In the Name and Location page, name the project and specify the location of project files.

  4. To set the new Composite Application project as main, leave the Set as Main Project checkbox selected.

  5. 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:

  1. 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.

  2. Watch for the BUILD SUCCESSFUL message in the Output window.

Adding JBI Modules to Composite Application Projects

ProcedureTo add a JBI module to the Composite Application project:

  1. In the Projects window, right-click the Composite Application project's node and choose Add JBI Module.

  2. 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.

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.

ProcedureTo deploy a Composite Application Project:

  1. Right-click the Composite Application project's node, and choose Deploy Project.

  2. In the Warning dialog box, make sure the GlassFish V2 is selected and click OK.

  3. 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.

  4. 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.

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

ProcedureTo create a sample BPEL Module project:

  1. Choose File > New Project (Ctrl-Shift-N).

  2. In the Categories list, expand the Samples node and select SOA.

  3. In the Projects list, select the sample project you want to create and click Next.

  4. In the Name and Location page, name the project and specify the location of project files.

  5. 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.