Developer Guide to BPEL Designer: The BPEL Project

Last Updated: 23 October 2006
Contributed by Bob May, maintained by Dmitry Markovski


Contents

Developer Guide to BPEL Designer


Understanding the BPEL Project

To create your own BPEL project, you can either create your own BPEL module from scratch or begin by creating sample processes.

The BPEL project provides the NetBeans Enterprise Pack/runtime integration by enabling point-and-click support for the following:

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

  1. Build your BPEL Module project.
    Use the BPEL Designer to create the project.
  2. Create a Composite Application project.
    Create the project if you have not created it earlier; for sample processes, Composite Application projects are created automatically for you.
  3. Add the BPEL Module as a JBI Module to the Composite Application project.
  4. (Optional) Build the Composite Application project.
  5. Make sure that the Application Server is started.
  6. Deploy the Composite Application project
  7. Create test cases.
    For sample processes, test scenarios are automatically created for you; for new projects, you need to create at least one test scenario.
  8. Run one or all test cases.

Deploying and testing require that the Application Server is running.

The build, deploy and test run steps are specific to the Runtime integration. At this time there are no standards for these tasks in the BPEL server community, so these tasks are necessarily specific to a given server vendor.

The BPEL source artifact generated by the BPEL project Design view will be close to the standard BPEL 2.0 with the exceptions listed in BPEL 2.0 Elements Not Present in This Release.

top


Creating a New BPEL Project

You can use the IDE to create a new BPEL Project. To do so:

  1. In the IDE, from the main menu, choose File > New Project and then perform the following steps:
    1. Under Categories, select Service Oriented Architecture.
    2. Under Projects, select BPEL Module.

    Step 1

  2. Click Next.
  3. Supply the Project Name, Project Location and Project Folder fields or accept the defaults.
  4. Click Finish.

    Step 2

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

    BPEL Module node

  5. To create a BPEL file for your project, right-click the Process Files node and choose New > BPEL Process from the pop-up menu.
  6. In the New BPEL Process dialog box, specify the file name, folder and target namespace. Click Finish.

    New BPEL Process file

  7. To create a WSDL file for your project, right-click the Process Files node and choose New > WSDL from the pop-up menu.
  8. In the New BPEL WSDL dialog box, specify the file name, folder and target namespace. Optionally, select the Import XML Schema File(s) checkbox and browse for a Schema file to import. Click Finish.

    New WSDL file

Exploring the BPEL 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 Source Editor contains a tab for newProcess.bpel .
    • The newProcess.bpel diagram is shown in the Design view.
      The Design view is the business processes visual designer. In this view, you can visually model a business process. The BPEL Design tool automatically generates BPEL code that corresponds to the visual design.
    • The Palette of BPEL elements opens to the right of the Source Editor.
    • 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 > BPEL Mapper from the main menu).

    BPEL File Open
    Click to enlarge

  3. 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 node and choosing Properties. The tree in the left pane shows that you have access to two pages:

The General page allows you to view the path of the folder containing the project's files, to view or modify the prefix for the project service engine (such as com.sun.bpelse), and to supply aliases and descriptions for the project's Assembly Unit and Application Subassembly.

The Subproject References page appears only for BPEL Module projects that can contain subprojects. It allows you to view, add, remove, and rearrange subprojects (.jar files) referenced by the BPEL Module project.

top


Creating a New JBI Deployment Project

A BPEL project is not directly deployable. You must first add a BPEL 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 be run. For more information on Composite Application projects, see The BPEL Runtime section.

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:

  1. Choose File > New Project (Ctrl-Shift-N).
  2. In the Categories list, select Service Oriented Architecture 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. To be able to deploy and test-run 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's node and choose Build Project.
  2. Watch for the BUILD SUCCESSFUL message in the Output window.
  3. You can also perform a clean build by right-clicking the BPEL Module's node in the Projects window and choosing Clean and Build Project.

Adding JBI Modules to Composite Application Projects

To add a JBI Module project 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.

top


Deploying a Composite Application Project to the JBI Server

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

You can deploy the Composite Application Project:

  1. Right-click the Composite Application project node, and choose Deploy Project.
  2. In the Warning dialog box, make sure the Sun Java Application Server is selected and click OK.
  3. Deployment has succeeded if you see the success messages in the Output window.
  4. If the Output window is not visible, choose Window > Output.
  5. Switch to the Runtime window and expand Servers > Sun Java System Application Server > JBI, right-click the Service Assemblies node, and
  6. Choose Refresh. You should see the the deployed Service Assembly.

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 create separately each of these projects. However, to deploy the sample application, you need to manually add the BPEL Module 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 operations 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 Project: General Flow

To create a sample BPEL project:

  1. Choose File > New Project (Ctrl-Shift-N).
  2. In the Categories list, expand the Samples node and select Service Oriented Architecture.
  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 process, add the sample BPEL project as a JBI module to the Composite Application project.

top


Copyright and Trademark Notice