Using the BPEL Designer and Service Engine
Navigating the BPEL Designer
This section explores the navigation capabilities of the BPEL Designer.
- The BPEL Editor Views
- The Navigator Window
- The Properties Window
- Zooming In and Out
- Printing BPEL Diagrams and Source Files
The BPEL Designer Window
The new BPEL file opens in the Design view of the BPEL Designer.
To open the BPEL Designer, either create a new BPEL Process or open an existing BPEL Process. The image above shows the NetBeans IDE open to the BluePrint1 Project's BPEL process in the BPEL Designer. If the Pallet and Properties windows are not displayed in your current view, click Windows → Reset Windows from the NetBeans menu.
Notice the following BPEL Designer components:
- The BPEL Editor resides in the center pane of the BPEL Designer. The Design view of the BPEL Editor enables you to visually model the business process. The BPEL Designer automatically generates BPEL code that corresponds to the visual design.
- The Pallet, available in the designers upper-right pane of the Design view, provides easy access to the BPEL elements.
- The Properties window, available in the lower-right pane of the Design view, provides the property sheet for any selected component or activity.
- The Navigator window, available in the lower-left pane, shows the BPEL Logical View of the BPEL process.
- To see the Source view of the BPEL Editor, click the Source button. The Source view displays the code for the current process.
- To see the BPEL Mapper view, select a BPEL activity in the Design view of the editor, then click the Mapper button. The Mapper view of the BPEL Editor provides a framework that enables you to define and direct BPEL process data.
- To see the BPEL Logger view, select a BPEL activity in the Design view of the editor, then click the Logger button. The Logger, similar in appearance to the BPEL Mapper view, enables you to select the level of logging for the various process activities.
The BPEL Editor Views
In the BPEL Editor you can switch between Source View, Design View, Mapper View and Logging View. All the views are always kept in sync.
- Design View: The Design view is a business processes designer where you can author a diagram of your business process. In the Design view, you add, edit, and delete diagram elements. The diagram constructed in the Design view is automatically generated into BPEL source code compliant with the WS-BPEL 2.0 specification with the exceptions listed in the BPEL 2.0 Language Constructs section of the https://open-esb.dev.java.net/kb/preview3/ep-bpel-se.html.
The Design view opens by default when you double-click a BPEL file from a BPEL Module project in the Projects window. To switch to the corresponding place in the Source view, right-click an element in the Design view and select Go to Source (Alt-O).
- Source View: The Source view shows the underlying code for a business process diagram. The Source view is based on the NetBeans IDE's XML Source view, and provides access to conveniences such as code folding, XML syntax highlighting, and code completion.
You can perform source level editing as well as visual designing. The BPEL Designer will perform round-trip two-way engineering to ensure that the Design view and Source view remain synchronized with each other. The NetBeans IDE automatically re-parses the BPEL source file and rebuilds the diagram every time you perform manual edits of the source file.
To switch to the corresponding place in the Design view, place a cursor at the line in the Source view, right-click and choose Go to Design (Alt-D).
- Mapper View: The BPEL Mapper provides a framework for processing and directing BPEL process data. The BPEL Mapper can be used to assign values or to set conditions. To switch to the Mapper view press Ctrl-Shift-F9, or click the Mapper tab on the editor toolbar, or just double-click an activity in the diagram. For more information, refer to Using the BPEL Mapper section.
- Logging View: The Logging view provides you with the capability to set logging or alerting rules for the process. The Logging view is similar to the BPEL Mapper in use. To switch to the the Logging view press Alt-L or click the Logging tab on the editor toolbar. For more information see BPEL Process Logging and Alerting section.
Cloning Document Views
The Clone Document feature is a customization option which enables you to clone documents views. For example, if you want to see both the source and the design view of a BPEL process at the same time (or the Design and Mapper view) follow the instructions below.
Several views of one document are always kept in sync.
To Clone the Document View:
- Open the BPEL file
- Right click the tab with the file name and choose Clone Document. Another tab with the same document will be created.
- Drag and drop one of the tabs to the location you choose: left, right or to the bottom of the screen. An orange frame will show you where the window you are dragging will be placed.
Element Documentation and Report Generation
The BPEL Designer includes a feature that allows you to create comments (documentation) attached to the elements of the BPEL Process. This documentation is then included with the source code of the BPEL process and can later be extracted and included in a report.
Creating Documentation for an Element
- Select an element on the diagram or in the Navigator window.
- Click the selected element's Document icon. A Documentation window appears.
- Type any information or comments that you feel are useful into the Documentation window. This Documentation is now available anytime you open this window and is also available in the element's Properties file, added to the Documentation property.
Documentation that is added to the Documentation property in the element's Properties file is also available when the element's Documentation icon is selected in the Documentation window.
Generating a Report
The Report Generation feature of the BPEL Designer enables you to generate a PDF document describing the BPEL Process. By creating a custom report, you can create a more verbose report or include only elements that have documentation in the report.
- From the BPEL Diagram toolbar press the Generate Report button. The report, in PDF format, is added to the project's Process files in the Projects window.
The report includes following information:
- The name of the process
- The diagram
- Information about imported documents
- Information about partner links
- A list of all defined variables
- Information about the process elements
- Documentation created for the process elements
- To customize a report to include all of the element properties or to only include elements with documentation, click the Customize Report button in the BPEL Diagram toolbar.
A Customize Report dialog box appears.
- Choose Generate Verbose Report to include all of the element properties in the report.
- Choose Include Only Elements with Documentation to only include elements with documentation to be included in the report.
- Click OK, and click the Generate Report button. If a report already exists, the new report will overwrite the existing report in the Projects window.
The Navigator Window
The Navigator window is a companion of the BPEL Designer. If the Navigator window is not visible, you can manually invoke it by selecting Window
from the main menu or pressing the Ctrl-7
The Navigator window provides two distinct views of the BPEL process: BPEL Logical View
and XML View
. You can switch between the XML View and BPEL Logical View using the drop-down menu in the upper part of the Navigator window.
The XML View is identical to the Navigator view that is available for all XML documents opened in the IDE. The XML View is a companion to the BPEL Source view. Double-click any Navigator node and the Source view adjusts the current line of code to show the selected element.
The Navigator also provides the BPEL Logical View of BPEL processes. When you select BPEL constructs in the Design view, the BPEL Logical View shows the same element selected. Alternatively, when you select a node in the BPEL Logical View's tree, the corresponding element is selected on the diagram.
When you right-click a node in the BPEL Logical View it invoke a pop-up menus with actions that are relevant to the particular node. For example, for the Assign
element, the actions are Go to Source
, Go to Design
, Wrap With
, Move Up
, Move Down
, Toggle Breakpoint
, Show BPEL Mapper
, and Properties
. The Go to Source
and Go to Design
actions, available for most of the nodes, have associated keyboard shortcuts: Alt-O
for Go to Source
for Go to Design
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.
To view the variables used in the business process, expand the Variables
node in the BPEL Logical View of the Navigator window. For variables, the following commands are available in the pop-up menu:
- Go To Source: Opens the source of the BPEL file and places the cursor at the place where the variable is mentioned for the first time.
- Go To Type Source: Opens the source file that contains a definition of the variable type. This can be, for example, a WSDL file.
- Find Usages: Shows usages of variables in the BPEL file. This command is also available from the pop-up menu for correlation sets and Partner Link elements.
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. Using the pop-up menu for the Imports
node, you can add reference to an XSD or WSDL file. Note that only files located in the project folder may be referenced.
To add a resource file (WSDL or XSD) as an import:
- In the BPEL Logical View of the Navigator window, right-click the Imports node and choose one of the following, depending on the format of the imported file: Add WSDL Import or Add Schema Import.
- In the Create New Import dialog box, select a file in your project structure to add it as import.
Note: Before you can import a file, you must first add the files stored in your project directory to the project structure, then you can add them as imports. The files that are already referenced are displayed in the strikethrough style.
- View the values in the read-only Namespace and Type fields and click OK.
The resource file you have just added appears under the Imports node in the Navigator window.
To add a property to a WSDL file:
From the Navigator window you can add properties and property aliases to the WSDL files referenced in the BPEL document.
- In the BPEL Logical View of the Navigator window, 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:
- In the BPEL Logical View of the Navigator window, 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.
If the Synchronous with Tree checkbox is selected, the Query field is updated each time you change the selection in the Map Property To tree.
- Click OK.
For more information on defining properties and property aliases with the WSDL Editor, refer to the Using the WSDL Editor.
The Properties Window
The Properties window contains the properties information for the currently selected element of the process. You can also use the IDE's Properties window to configure all BPEL element properties. The contents of the Properties window differs depending on the active element of the process. To open the Properties window, choose Window
or press Ctrl-Shift-7
When you open a BPEL file from the Projects window, the diagram opens in the Editing Mode of the Design view by default. In this mode, you can edit the diagram and scroll through it. The Editing Mode is enabled when the Navigation mode is selected on the Editor toolbar.
In the Editing mode, you can scroll through the diagram by using the following methods:
- Turning the mouse wheel
- Using the horizontal and vertical scroll bars
- Using the thumbnail view to select the section of the diagram to display. To access the thumbnail view, click the Thumbnail button located below vertical scroll bar, or press Ctrl+B
- Pressing the Tab key to move through elements
Collapsing and Expanding Process Blocks in the Diagram
The diagram enables you to collapse and expand process blocks to allow you to focus on other processes.
To collapse and expand a process block:
- Click on the block's border to highlight the block. A Collapse button appears above the left corner of the block.
- Click the Collapse button. The process block is displayed as a small block in the diagram flow.
- To expand the process block, click the Expand icon in the center of the collapsed process block. That block is expanded.
Zooming In and Out of the Diagram
The zoom feature allows you to reduce the size of your diagram to see more of it, or to enlarge the diagram for a closer view.
You can change the zoom value using the Zoom Value drop-down list on the Editor toolbar.
- To scale the diagram to fit the window, click Fit Diagram.
- To scale the diagram width to fit the window width, click the Fit Width button.
Note: The minimum scale size is 33%. Some large diagrams might not fit entirely the window.
To change the scale do one of the following:
- Click the Zoom In or Zoom Out button on the toolbar.
- Click the Fit Diagram button on the toolbar to scale the diagram to fit the window.
- Click the Fit Width button on the toolbar to scale the diagram width to fit the window.
- Turn on Navigation Mode on the toolbar, then you can zoom in and out using the mouse wheel.
Printing BPEL Diagrams and Source Files
You can print BPEL diagrams and source files and customize printing settings, including border, headers, footers, colors, line numbers, and zooming, to suit your preferences.
To preview and print a BPEL diagram or source file:
- Open a BPEL file in the Design view.
- Choose File from the main menu and select one of the following commands:
- Print Preview: Previews the print layout or configure print settings.
- Print to HTML: Prints the .bpel file as an HTML file.
To customize print options:
- In the NetBeans IDE, select the object you want to print.
- In the Print Preview window, click Print Options. The Print Options dialog box opens.
- Change the print settings to suit your preferences:
- Print Border: Adds a border to the printed page. Click the Color icon to change the border color.
- Print Header and Print Footer: Specifies the text, alignment, color, and font of the header and footer.
- To hide the header or footer, clear the Print Header or Print Footer checkboxes, respectively.
- To specify the header or footer pattern text, click in the field corresponding to the alignment (Left, Center, or Right) and select one of the buttons below. For example, to add the time of printing at the bottom left corner, select the Print Footer checkbox, click into the Left field, and click the Time of printing icon.
- Click the Choose Footer Color and Choose Footer Font icons to modify the color and the font for the page header and footer.
- Line Numbers: Specifies whether to print line numbers for source files.
- Wrap Lines: Wraps the lines to fit them on the page.
- Print as in Editor: The printed page will look like you see it in the editor.
- Text Font and Color: Specifies the color and font of the text when you are printing, for example, source files.
- Background Color: Specifies the background color.
- Line spacing: Specifies the value for line spacing.
- Zoom: Specifies the scale for the printed text or diagram on the page. You can select to fit width or height or choose a specific zoom scale.
- Click OK.
To customize page settings:
- In the NetBeans IDE, select an object you want to print.
- Choose File → Print Preview.
- In the Print Preview window, click Page Setup. The Page Setup dialog box opens.
- You can also invoke the Page Setup dialog box by choosing File → Page Setup.
- On the Page Setup page specify the following parameters:
- Paper size
- Source of the paper
- Paper orientation
- Margin sizes
- Click the Printer button and specify the printer.
- Click Ok.
Note: You can also easily print your diagram as part of a report created by clicking the Generate Report button. For more information on generating reports see Element Documentation and Report Generation above.