Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 19 Mapping and Transforming Data : Overview of Mapping and Transformation

Overview of Mapping and Transformation
The Function Argument Mapper allows you to supply the data that a function expects as input.
For instructions on accessing the Function Argument Mapper in the rule editor see Using the Function Argument Mapper
Function Section
The function section, in the upper part of the dialog, shows the view-only name of the function you are working with and the editable entity path to the item whose properties and attributes you want to map to the function arguments.
Input Section
Scope Variables Panel
The scope variables panel shows the list of properties and attributes available to the function, as well as global variables defined in the project.
Function Panel
The function panel uses an Extensible Stylesheet Language Transformation (XSLT) template that specifies how scope variables should be transformed to provide the expected input. Normally, you do not need detailed knowledge of XSLT to specify a function’s expected output. However, if you are familiar with XSLT and you wish to see the actual code, you can right-click on any item in the Function panel and choose Copy from the popup menu. Then open a blank text document and choose Paste. The XSLT is displayed in your text document.
You can also use your own XSLT templates to perform transformations instead of using the techniques described in this chapter. You can paste XSLT into your function input fields, or into the XPath Formula field in XPath Formula Builder. (You cannot, however, paste XSLT directly into the function argument in the rule editor.)
Mapping and Transforming Data to Function Input
Assigning an empty string ("") to a field in a mapper function results in a null string.
To map data, select an item in the Scope Variables panel, then drag and drop that item into the desired schema element in the Function panel.
Simple mappings appear in the formula area to the right of the input element after you release the mouse button. For more complex mappings, click the Edit Statement () button.
Most options in the Edit Statement dialog are straightforward. However, there are some complex scenarios that require multiple steps. Many of these situations are described in the section Examples of Mappings. You may also wish to refer to XSLT Statements for a reference of XSLT statements when deciding which XSLT statement can be used to achieve the result you desire.
You can specify XPath formulas to transform an element if you need to perform more complex processing. The XPath Formula Builder allows you to easily create XPath formulas. For more advanced use of XPath, see Chapter 20, XPath Formula Builder. There are also a variety of third-party books and resources about XSLT and XPath.
The datatypes of the function’s arguments display as hints. Once a mapping or formula is specified, a hint becomes an XSLT statement. See Statements, Hints, and Errors for more information about hints and statements.
Statements, Hints, and Errors
When you display the Function tab, the existing statements are examined, and any input elements that do not have a statement are displayed as hints. Hints are reminders that you can specify a statement for the input element, but they are not stored as part of the XSLT template for the function’s input. Hints are displayed in italics with a light blue background. Once you specify a mapping or a formula for a hint, the input element becomes a statement. You can also drag the hint to the left past the dividing line between the panels and the hint becomes a blank statement.
Once you specify a statement in the Function panel and click OK, it becomes part of the XSLT template used to create the input data. Statements are only deleted if you manually delete them using the delete button, or if you use the Mapper Check and Repair (button to automatically fix errors. Therefore, if the input schema for the function changes, your statements may no longer be valid. See Repairing Incorrect Mappings for more information about using the Mapper Check and Repair button to fix statements in the Function panel.
Any statement or hint that has an error is displayed in red. A hint is only displayed in red if it is a required input element. All required input elements must have statements specified. The Mapper Check and Repair button can help you automatically fix some errors. See Repairing Incorrect Mappings for more information about fixing errors.

Copyright © TIBCO Software Inc. All Rights Reserved