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.
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:
Right-click a WSDL file under the Imports node and choose Add Property from the pop-up menu.
In the Create New Correlation Property dialog box, specify the property name.
Select the property type and click OK.
To add a property alias to a WSDL file:
Right-click a WSDL file under the Imports node and select Add Property Alias from the pop-up menu.
In the Create New Property Alias dialog box, click Browse next to the Property field to specify the property.
In the Property Chooser dialog box, select the property for which you are creating the alias and click OK. The Property Type field in the Create New Property Alias dialog box is populated with the type.
In the Map Property To tree, expand the WSDL file node and select the message or message part.
To add a query, enter the query string in the Query text field.
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:
Create elements, connections and activity structures on a diagram. Drag elements from the Palette to the diagram. The Visual Designer supports the notion of "drop points", which means that you must align elements with these drop points when you drag them. Not all elements are created via drag-and-drop from the Palette. These other elements are created through context menu actions which are invoked when you right-click an existing diagram element.
Select elements on a diagram. A single click on an element selects it. Selection is a necessary step in performing several other operations, such as deleting, moving, or editing an element.
View and modify diagram element properties. All of the elements have properties. When you select an element, the standard NetBeans Properties window will show the properties specific to that element. Some BPEL elements have more complex property editors which are shown in a modal pop-up dialog. The modal property editor can be invoked in several ways for those elements that support such an editor. You can double-click the visual element and the modal property editor will appear. Alternatively, you can right-click the element and choose Edit from the pop-up menu and the modal property editor will appear. Not all BPEL elements have modal pop-up property editors. For those elements that do not have modal pop-up property editors, you should just use the standard NetBeans Properties window to adjust the element properties. The Properties window can also be invoked by right-clicking the element and choosing Properties from the pop-up menu.
Perform pop-up menu actions on the diagram elements. Each BPEL element has a pop-up menu. This pop-up menu can be invoked by right-clicking the element. The pop-up menu will offer a set of actions which are relevant to the selected element.
Save diagram changes. Once you make changes to the diagram you have created and/or modified, you can save them.
Reopen saved diagrams. You can reopen any diagrams you have saved by double-clicking the corresponding BPEL source file in the Projects Window.
Move diagram elements. You can move diagram elements by selecting the element and then dragging it to a new location.
If you move a container element, all its children move along with the container.
In this release you cannot select multiple elements and move them together. The exception to this is the statement above, where you can move a single container element and all of its children.
Print source or diagrams. You can print both the BPEL source and the BPEL diagram. To print the BPEL diagram, the BPEL Design view must be open. To print the source, the BPEL Source view must be open. To print, invoke the File > Print or the File > Print Preview commands from the main menu.
Zoom in and out of the diagram. You can move the zoom slider on the editor toolbar to reduce or enlarge the size of the diagram. To view the entire diagram, click the Fit Diagram button. To view the full width of the diagram, click the Fit Width button.
Edit element names in the Visual Designer diagram directly. Double-click the element name on the diagram to edit it.
Invoke XML Validation. You can invoke XML validation by clicking the Validate XML button on the Design view editor toolbar. For more information, see the Validation section.
Apply filters to the diagram elements. The Design view editor toolbar contains the Show Partner Links and Show Sequences toggle buttons. Both PartnerLink elements and Sequence elements are shown by default. Clicking the Show Partner Links button hides the PartnerLink elements on the diagram. Clicking the Show Sequences button hides the Sequence containers on the diagram. Clicking either button a second time will again reveal the PartnerLink elements, or the Sequence elements on the diagram, respectively.
Note: You cannot add new PartnerLink or Sequence elements to the diagram if you chose not to show them.
Using the Visual Designer
When you use the Visual Designer, please keep the following in mind:
Keyboard shortcuts are available for the Visual Designer. The keyboard shortcuts include:
The Del key is equivalent to invoking the Delete command from the pop-up menu, and removes the currently selected element.
The Esc key cancels a current drag-and-drop operation.
The Alt+O key combination opens the source of the BPEL file and puts the cursor at the first line of code corresponding to the selected diagram element.
One operation can be used by many activities.
When a diagram is large and does not fit into the current view port bounds, you can drag elements to a placeholder outside of the view port bounds. The diagram scrolls when you drag an element.
You can use the mouse wheel or arrow keys to scroll through a diagram.
You can use the Palette Manager to enable, disable, and rearrange the Palette elements. The Palette Manager is invoked by right-clicking the Palette and choosing Palette Manager.
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,
Right-click the element and choose Edit, or
Double-click the 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:
Changes you make in a diagram are reflected immediately in the corresponding source code.
Changes you make in the source code are reflected on the diagram when you switch to the Design view.
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:
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.
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.
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:
Select a web service activity. A small envelope appears on the left side of the activity icon.
Start dragging the envelope. The IDE displays a dashed line that links the source activity to the envelope you are dragging.
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:
Web Service: Elements used for exchanging messages in a conversational manner with a partner web service.
Basic Activities: Activities that perform a certain task.
Structured Activities: Elements used to precisely order sets of activities. Structured Activities can contain other activities.
Icon
Element
Definition
Web Service
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
Allows the business process to perform a blocking wait for a particular message to arrive.
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
Enables the business process to send a message in reply to a message that was received through a Receive.
Basic Activities
Empty
An activity that does nothing, useful when you need to catch and suppress a fault.
Wait
Waits until a given point in time or for a specified duration.
Throw
Generates a fault from inside the business process.
Assign
Updates the values of variables with new data.
Exit
Immediately terminates the execution of the business process instance.
Structured Activities
Flow
Specifies one or more activities to be performed concurrently.
Sequence
Defines a collection of activities to be performed sequentially, in lexical order.
If
Selects one branch of activity from a set of choices.
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
Defines a nested activity with its own associated local variables, event and fault handlers, and message exchange.
While
Repeats an activity while a condition is true. The condition is checked before the execution of the activity.
RepeatUntil
Repeats an activity until a condition is true. It is different from While in that the condition is checked after the execution.
ForEach
Repeats an activity exactly N+1 times, where N equals the Final Counter Value minus the Start Counter Value.