In this section: |
The Output Node Mapping Builder is a tool available in Transformer as part of the Mapping Builder facility. It allows you to construct an output node using various methods and formulas implemented in iWay Transformer as functions. You can access the pre-defined functions and the custom functions that you defined, or build the statement containing several functions if needed.
In Transformer, the pre-defined functions are subdivided into the following categories:
After selecting a specific function, typically you will need to define the set of parameters associated with it. The number and the names of the parameters for the particular function can be determined in either of the following ways:
@SUBTRACT (number1, number2)
For more details on the parameters to specify for each particular function, see Pre-Defined Functions for a complete reference. If dealing with custom functions, you may consult the author of the function.
Generally, the functions can take four types of values as their parameters:
A function of a parameter can take the value of a specified input node. For information on how to set an input node, see How to Set an Input Node.
You can nest functions within functions, which means the output result of a certain function can serve as the input parameter for another function. For more details, see How to Nest Functions.
You can also set a specific invariable value as a constant function parameter. For information on how to set a constant value, see How to Set a Constant Value for a Function.
Another option for a function parameter type is an expression which is a basic combination of operators, input nodes, and/or constants. For information on how to set an expression, see How to Set an Expression for a Function.
The Output Node Mapping Builder enables you to set the output node values using a combination of functions and/or input nodes. Both custom and pre-defined functions can be utilized. When specifying a function through the Output Node Mapping Builder, you must know what the specific function does and how to specify the parameters for it. For more information, see Pre-Defined Functions.
The following image shows the Mapping Builder interface in Transformer.
To open the Output Node Mapping Builder:
The Output Node Mapping Builder displays as shown in the following image.
The left pane of the Output Node Mapping Builder dialog box provides you with the option of switching between the following areas:
The Functions and Input panes are available by default. The remaining panes are only available if specific values are configured in the corresponding sections of the Project Properties dialog box. For example, if a global constant is configured using the Project Properties dialog box, the Global Constants pane would be enabled in the Output Node Mapping Builder.
This feature allows you to drag and drop any available configuration that was specified using the Project Properties dialog box into the workspace area of the Output Node Mapping Builder. You can switch between the available panes by clicking on the corresponding button, for example, Global Constants, JDBC Data Source, and so on. You can access the Project Properties dialog box directly from the Output Node Mapping Builder, by clicking the View Project Properties button on the lower-left corner, as shown in the following image.
Note: In the Output Node Mapping Builder, when you select a link in the tree structure, the highlighted link changes to red, which indicates that it is selected.
To select a function:
For a list of function categories, see Using the Output Node Mapping Builder.
The following image shows String Functions selected in the Category drop-down list, which is located in the Functions pane.
Optionally, you can skip to step 2 and select your function from the whole list of available functions.
Note: You can drag and drop functions above or below the existing mapping tree in the workspace area as needed to create a combination of output values.
The function you choose becomes your working function.
To set an input node as the value for a function parameter:
An alternate way to perform this task is to use Set Selected Input option from the context menu which appears when you right-click the parameter in the workspace area.
Note: Another method for editing the mapping formula of your node is to type it directly in the preview area located on the lower-right corner of the Output Node Mapping Builder window and press Enter. The tree structure will be refreshed. However, this option is recommended for advanced users only. Using the drag and drop interface instead is strongly encouraged.
If you decide to type the mapping formula manually and it is incorrect, an Invalid signature error message is generated.
To specify another function as a parameter for your working function:
An alternative way to perform this task is to use Set Selected Function option from the context menu which appears when you right-click the parameter in the workspace area.
You must set the parameters for the nested function as well.
Note: You can nest functions multiple times.
To set a constant value:
You can also double-click the parameter box to set a constant.
The following image shows the Constant option selected and a field where you can enter a value.
To set an expression:
You can also double-click the parameter box and select the Expression radio button to set an expression.
An expression concatenation is typically used for any number of input items and constant values in any order, in the following format:
<input item>+'constant'+...
For example:
'For '+tree/fruit+tree/fruit/year+': '+tree/fruit/apple/yield+ ' bushels, '+tree/fruit/apple/avgweight+' grams avg.'
To remove a value for a function parameter:
A context menu opens as shown in the following image.
The parameter is removed from the function.
To cancel and restore an action within the Output Node Mapping Builder:
A context menu opens as shown in the following image.
The last action is removed from the workspace.
A context menu opens as shown in the following image.
The last removed action is returned to the workspace.
Note: Multiple levels of undo and redo are supported. You can select Undo/Redo or use the corresponding keyboard shortcut (Ctrl+Z/Ctrl+Y) multiple times until you have achieved the desired result.
iWay Software |