Using A Script to Define a Mapping

You can use the Script Editor to modify mappings from process data to service input/output parameters or fault messages.

Note: For simple transfer of data between different process data, it may be easier to create scripts with Data Mapper instead of writing them in JavaScript. See Data Mapping and Mapping Contents in Data Mapper.

Procedure

  1. Select the Script Grammar that you wish to use, either:
    • JavaScript, to enter a JavaScript script.
    • XPath, to enter an XML Path Language expression.
  2. Click New Script in the appropriate mapping tab.
  3. Enter your script in the Script Editor.
    Note: Scripts are validated as you enter them. Validation markers are displayed if any errors occur.

    You can also use content assist in the script Editor by pressing Ctrl + Space.

  4. When you have finished, click outside of the Script Editor. A script called Scriptn is displayed in the tab. (You can rename it by right-clicking the script name, and selecting Rename Script.)
  5. Map the script by dragging it from the left side of the mapper to the appropriate entity on the right-hand side.