To assign a function while creating maps:
Procedure
- Select the Function tab. In the Function tab,
the list of available functions is displayed.
- From the Function tab, drag a function
between the two nodes you want to map in the Mapping Editor.
- Drag the source node onto the function icon to create a
link. The source node is assigned to the first parameter of the function.
During run time, the value of this source node is provided as the
first parameter of the function.
- Drag the destination node onto the function to create the
link. During run time, the return value of the function populates
the destination node.
- If the function has more than one input parameter, you
must assign the remaining input parameters using one of the following
options:
- Create links from other source nodes (as described above in
step 3) or from functions used in the current mapping rule.
- Edit the assignment of input parameters using the Functions
Properties dialog box. To open the Functions
Properties dialog box, double-click the function in the
Mapping Editor.
- Optional: Add additional functions to the mapping
rule using the procedure described in the topic Adding a Function to an Existing Mapping Rule.
For an example, see Example:
Chaining Multiple Functions below.
- Optional: If any functions are still associated
with the mapping rule, test if the mapping rule is valid by right-clicking
on the function in the mapping rule and selecting Apply
Function Graph. If the mapping rule is valid, the
square function icon or icons in the graphical representation of the
mapping link are not displayed and a blue bar with small squares at
each end is displayed (
). If the mapping rule is not valid, the graphical representation
of the mapping rule does not change, the function icons are still
visible, (for example
) and an error dialog opens. Note: A mapping rule
with function or functions is considered valid if all the input parameters
of the function or functions are assigned with values of the correct
datatype and if the return value of the last function matches the
datatype of the destination node. The input parameters of a function
can be provided by source nodes or by the return type of other functions
associated with that mapping rule.