Developer Guide to BPEL Designer: The BPEL Design and Source View

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

Contents

Developer Guide to BPEL Designer


Understanding the BPEL Design and Source View

This guide provides information on the BPEL Designer, which enables you to visually author a process diagram that will be automatically generated into BPEL source code compliant with the WS-BPEL 2.0 specification.

When you double-click a BPEL file, the IDE opens the Visual Designer Palette, the Navigator window, the Properties window and a multi-view editor. This editor contains two views: Design view and Source view.

Design View

The Design view is the business processes visual designer. In this view, the business process author can visually model a business process. The BPEL Designer automatically generates BPEL code that corresponds with the visual design. The notation used in the visual designer is loosely based on BPMN (Business Process Modeling Notation).

Source View

The Source view is the BPEL source file editor. In the Source view, the business process author can textually edit the business process source code. You can perform source level editing as well as visual designing. The BPEL project will perform round-trip two-way engineering to ensure that the Design view and Source view remain synchronized with each other.

The IDE will automatically re-parse the BPEL source file and rebuild the diagram every time you perform manual edits on the source file.

top


The Navigator

The Navigator window is a companion of the BPEL editor. If the Navigator window is not visible, you can manually invoke it by selecting Window > Navigator from the main menu or using the Ctrl+7 key combination.

The Navigator window provides two distinct views of the BPEL process. First, it provides the NetBeans standard outline view of the BPEL source code as XML.

XML View

The XML View is identical to the Navigator view that is available for all XML documents opened in NetBeans. The XML View is a companion to the BPEL Source view. Double-click any Navigator node and the Source editor adjusts the current line of code to show the selected element.

Logical View

The Navigator also provides an additional Logical View of the BPEL process. The Logical View of the Navigator is a companion to the BPEL Design view. As you select visual elements in the Design view, the Navigator's Logical View shows the same element selected. Alternatively, when you select a node in the Logical View's tree, the corresponding element is selected on the diagram.

Right-clicking the nodes in the Logical View invokes pop-up menus with actions relevant to the particular node. For example, for the Assign element, the actions are Go to Source, Toggle Breakpoint, Delete, and Properties. The Go to Source and Delete actions, available for most of the nodes, have associated keyboard shortcuts: Alt+O for Go to Source and Del for Delete.

In general, the nodes in the Navigator window correspond to the elements on the diagram. In addition, there are nodes, such as Variables and Correlation Sets, that are related to functionality not directly accessible from the diagram.

Of particular relevance is the Imports node, which lists XSD and WSDL files referenced with the help of the Import element in your BPEL file. To add another reference to an XSD or WSDL file, right-click the node and choose Add Import from the pop-up menu. Only files located in the project folder may be referenced. After the operation, a new <import> line is added to the BPEL file.

You can add BPEL extensibility elements – properties and property aliases – to the WSDL files referenced in the BPEL document.

To add a property to a WSDL file:

To add a property alias to a WSDL file:

For more information on defining properties and property aliases with the WSDL editor, refer to Defining Properties and Property Aliases.

You can switch between the XML View and Logical View using the drop-down menu in the upper part of the Navigator window.

top


Understanding the Visual Designer

When the Design view is active, the Visual Designer Palette is also visible.

Note: If the Visual Designer Palette is not readily visible, you can manually invoke it by selecting Window > Palette from the main menu.

The Palette provides the set of visual elements developers use to model business processes. The set of elements in the Palette corresponds to those BPEL elements which the business process author may wish to add to the diagram in a drag-and-drop fashion.

The Palette contains icons for most, but not all BPEL elements. The Palette does not contain icons for the BPEL elements that are only meaningful in the context of parent elements. The Visual Designer supports the construction of these additional BPEL elements via different design idioms not based on the Palette drag-and-drop feature.

Visual Designer

Within the Design view, you can perform many tasks that make up what is called Forward Engineering:

Using the Visual Designer

When you use the Visual Designer, please keep the following in mind:

Referential Integrity

Note that the Visual Designer automatically supports referential integrity in the Visual Designer but not in the Source Editor.

Defining Element and Activity Properties

For all elements, properties can be defined using property editors or the Properties window.

To open the property editor for an element,

To open the Properties window for an element, right-click the element and choose Properties.

The standard NetBeans Properties window corresponds to the selected element, If the standard NetBeans Properties window is not open, choose Window > Properties from the main menu (Ctrl-Shift-7).

Saving Your Changes

The BPEL Designer synchronizes the Design and Source views as follows:

Reverse Engineering

You can use the BPEL Designer to edit the source file directly and to have those changes reflected in the Visual Designer.

You might need to edit the source in the following cases:

  1. If you want to use a vendor-specific BPEL extension which is not part of the standard BPEL element set, you must us the Source Editor.
  2. If you need to add a BPEL construct for which the Design view does not provide a code generation opportunity. There are a few edge case BPEL constructs, like assignment of static XML to a variable, which are not covered by the current property editors.
  3. If, while using the source editor, you modify and save BPEL source that is not well formed, then the Design view will not be able to render a diagram for this "broken" BPEL. The Design view will display a page that says "Unable to show diagram". Return to the Source Editor to correct the error and, after correction, run the XML validator in the Source Editor to validate your changes. Once you have restored the BPEL source to a valid state, the Design view will once again be able to render the diagram.

Configuring Message Flows

Activities are diagram elements that represent BPEL activities involved in message flow.

A message flow is the dashed line that connects a web service activity (Invoke, Receive, Reply) to its corresponding activity in a partner link. This relationship is called a message flow as it designates the flow of information to and from the process.

If you completely configure the Web Service activity by its Properties window, the IDE will render a message flow connector between an activity and a partner activity.

However, you can also directly draw a message flow. To do this:

  1. Select a web service activity. A small envelope appears on the left side of the activity icon.
  2. Start dragging the envelope. The IDE displays a dashed line that links the source activity to the envelope you are dragging.
  3. Move your mouse to the target activity. If the target activity is a match for the source, the mouse cursor indicates this, and you can release the mouse. The connection snaps into place between the activities.

Note that you cannot directly delete a message flow. You can indirectly delete a message flow by unsetting some of the properties in the the web service activity. Usually, however, you will change a message flow to create a different relationship.

Note also that the drawing tool works only in one direction: from a web service activity within the BPEL process to its corresponding activity in a partner link.

Changing Message Flow

If you want to change an existing message flow connection and establish a new connection with a different target activity, proceed as if you are making the connection for the first time with the preferred pairing. Once you create the new pairing, the IDE automatically removes the old connection.

Visual Designer Palette Elements

The following table lists the basic elements that appear on the Orchestration Palette. Not all BPEL elements are on the Palette; some are created when you right-click the diagram and choose appropriate actions from the pop-up menus.

Elements are of the following types:

Icon Element Definition
Web Service
Invoke Invoke Enables the business process to invoke a one-way or request-response operation on a portType offered by a partner; enables this process to send messages to partners. The operation is defined in the partner's WSDL.
Receive Receive Allows the business process to perform a blocking wait for a particular message to arrive.
Partner Link PartnerLink Identifies those web services that will exchange messages with our business process. Each partner link will contain child elements that correspond to the available web service activities supported by that partner link's interface.
Note: You do not directly add elements to a partner link container. The Design view will introspect the partner's WSDL and automatically populate the partner link container with the appropriate child elements. If you need to modify a partner link, edit the partner WSDL files which will allow the Design view to re-render the partner link and thereby reflect the modified interface.
Reply Reply Enables the business process to send a message in reply to a message that was received through a Receive.
Basic Activities
Empty Empty An activity that does nothing, useful when you need to catch and suppress a fault.
Wait Wait Waits until a given point in time or for a specified duration.
Throw Throw Generates a fault from inside the business process.
Assign Assign Updates the values of variables with new data.
Exit Exit Immediately terminates the execution of the business process instance.
Structured Activities
Flow Flow Specifies one or more activities to be performed concurrently.
Sequence Sequence Defines a collection of activities to be performed sequentially, in lexical order.
If If Selects one branch of activity from a set of choices.
Pick Pick Blocks and waits for a suitable message to arrive, or for a time-out to expire. When an event specified in the body of the Pick occurs, the Pick completes. Only one of the activities in the body of the Pick actually occurs.
Scope Scope Defines a nested activity with its own associated local variables, event and fault handlers, and message exchange.
While While Repeats an activity while a condition is true. The condition is checked before the execution of the activity.
Repeat Until RepeatUntil Repeats an activity until a condition is true. It is different from While in that the condition is checked after the execution.
For Each ForEach Repeats an activity exactly N+1 times, where N equals the Final Counter Value minus the Start Counter Value.

top


Copyright and Trademark Notice