Using the BPEL Designer and Service Engine

Using the JavaScript Element

The JavaScript activity acts like an Assign activity that enables you to use JavaScript (E4X), rather than using XPath 1.0. In many cases JavaScript can perform the same logic as XPath with much fewer processes.

Usage

Drag the JavaScript element from the Palette to the diagram. The JavaScript activity is added to the diagram and an empty extension assign operation is added to the source.

Image displays the empty extension assign operation created
by the JavaScript element in the BPEL Designer Source View

Double-click the JavaScript element in the diagram to open the JavaScript Editor. From the editor you can assign input and output expressions, and add your JavaScript code to the editor's text field.

Image shows the JavaScript Editor

The JavaScript Editor's Input button opens a dialog box to specify the input mapping between BPEL and JavaScript variables.

Image shows the JavaScript Editor Input dialog box

In the same way, the editor's Output button opens another dialog box to specify the output mapping between JavaScript and BPEL variables.

Image shows the JavaScript Editor Output dialog box

JavaScript Element Properties

The Properties window of the Assign element, invoked by right-clicking the element and choosing Properties, contains two properties: