Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Function Argument Mapping Wizard for XPath 2.0

Using the Function Argument Mapping wizard you can map the variable of the source to the argument of a mapper function.

## Functions Section

The Functions section is similar to the Function Argument Mapping wizard for XPath 1.0. It displays 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

The Input section in the Function Argument Mapping wizard for XPath 2.0 is a combination of the Input section of the Function Argument Mapping wizard for XPath 1.0 and XPath Function Builder. For XPath 2.0, there is no separate XPath Function Builder but it has been merged in the Function Argument Mapping wizard. However, the Function Argument Mapping wizard still performs the same functions and in the same way with only the user interface changes.

Figure 67: The Function Argument Mapping Wizard in XPath 2.0 Project

In the Input section, on the left side, there are three tabs: Data Source, Functions, Constants.

The Data Source tab is similar to the Scope Variables panel in the Function Argument Mapping wizard for XPath 1.0. It lists the properties and attributes available to the function, as well as global variables defined in the project.

The Functions and the Constants tab are the same tabs which are available in the XPath Formula Builder for XPath 1.0. However, the Functions tab now contains the XPath 2.0 mapper functions. Some of these new functions were provided by TIBCO in XPath 1.0, which are now part of the XPath 2.0 function library. See The XPath Formula BuilderYou access the XPath Formula Builder using a button in the Function Argument Mapping Wizard. First select an item in the Function Argument panel (in the Input section). Then click the XPath Formula Builder button (). The XPath formula builder allows you to drag and drop schema elements and XPath functions to create XPath expressions. The schema elements, when dragged into the XPath Formula field, automatically become valid XPath location paths for the desired item. If a function is dragged into the XPath formula window, there are placeholders for each parameter of the function. You can drag and drop schema elements over the parameter placeholders to replace each placeholder. The XPath Formula Builder describes the different areas of the XPath formula builder. XPath Formula Builder ReferenceElement Description Data tab Displays the Scope Variables schema tree. All elements in this tree are available to drag and drop into the XPath Formula field. Functions tab Displays the available XPath functions. These are categorized into groups and each function can be dragged from the function list into the XPath Formula field. When the function is placed into the XPath formula, placeholders are displayed for the function’s parameters. You can drag and drop schema elements from the Data tab into the function’s placeholders. The result of evaluating the function is displayed in the "Expression Evaluates To" panel. If there are any errors in the expression, they are listed there as well. For more information about XPath functions, see the description of the function that is displayed when it is selected in the XPath formula builder. Constants tab Displays the constants available for use in XPath expressions. These are categorized into groups and each constant can be dragged from the constants list into the XPath Formula field. Constants are useful for inserting special characters, such as tabs, symbols, and so on, into XPath formulas. Constants are also defined for commonly used items, such as date formats. Documentation panel Appears below the Functions and Constants tabs. Describes each selected function. As you click on a function in the Function tab, the documentation panel gives a brief description of the function and one or more examples. Similarly documentation for constants in the Constants tab appears. Evaluation Context field Displays the evaluation context of the expression field that the editor was invoked from. See Evaluation Context for more information about the evaluation context. XPath Formula field Displays the XPath formula you wish to create. You can drag and drop items from the Data tab or the Functions tab to create the formula. Expression Evaluates To Panel Displays the result of evaluating the formula shown in the XPath Formula field. If there are errors in the formula, they are displayed here. Creating an XPath formula illustrates using the XPath formula builder to create a valid function. The function concatenates the data elements $GetCustomerInformation/Street and $GetCustomerInformation/City and places a space between the two elements. Creating an XPath formula for more details about these tabs.

On the right side, similar to the Function panel in the Function Argument Mapping wizard for XPath 1.0 the XSLT template is present which specify how the Data Source would be transformed to provide the expected input. There is a toolbar which consists of the tools show the edit tab and auto-fix the errors.

Function Argument Mapping Wizard for XPath 2.0 Toolbar
Icon | Tool | Description
--- | --- | ---
| Remove Mapping | Removes the selected mapping from the selected attribute.
| Show Check and Repair | Displays mapper check and repair window similar to XPath 1.0. It verifies the XSLT template you have created in the Function panel against the expected input. A list of errors and warnings appear and you can choose which items you wish to fix. TIBCO BusinessEvents attempts to fix simple problems such as adding missing items that are expected and typecasting errors.
| Fix Typecasting Error | Fixes the typecasting error in XPath 2.0 where explicit casting is not done. For BusinessEvents, if the XPath expression elements cannot be implicitly cast, an error is displayed. For instance, if the XPath expression is $price > 1000, and $price is defined as a String, then an explicit cast must be done (the XPath 1.0 mapper does this casting implicitly).
| Show/Hide Edit Tab | Toggles the XPath expression editor for building complex XPath statement for the selected input argument. See XPath Formula Builder For XPath 2.0. This builder functions in the same way in which XPath Function Builder was working in XPath 1.0. See XPath Formula Builder For XPath 1.0 for more details.

## XPath Formula Builder For XPath 2.0

XPath 2.0 mapper do not have a separate window for XPath Formula Builder. The expression editor is now part of the Function Argument Mapping wizard and can be shown by the Show/Hide Edit Tab button.

Click the Show/Hide Edit Tab icon to display or hide the XPath Statement and XSLT Source tabs where you can build the complex XPath expression. You can use the data scope variables, mapper functions and constants from the respective tab on the left. In XPath 2.0, the behavior of the formula builder remains the same as XPath 1.0. See XPath Formula Builder For XPath 1.0 for more details about its functioning in XPath 1.0.

Figure 68: XPath Formula Builder for XPath 2.0

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.