Configuring Properties for Replace Functions

How to:

Replace functions are used to match and replace specific values of the input data. For example, suppose your input data has a node called "car_age" with a value of either "new" or "used". If you decide to substitute the term "used" and want to use "pre-owned", you can define a replace function with match and replace value pairing where the match value would be specified as "used" and the replace value is "pre-owned."

Replace functions work similar to custom functions in that you must first define the function itself and then, assign it in the output node mapping value which needs to be modified. This task can be accomplished with the @REPLACE and @SIMPLE_REPLACE functions.

The process of defining replace functions accounts for setting up the values to match and replace, but not the mapping. You must map the replace functions using the Output Node Mapping Builder. For more information, see Using the Output Node Mapping Builder.


Top of page

x
Procedure: How to Define A Replace Function

To define a replace function:

  1. From the menu bar, select Project and then, Properties.

    The Project Properties dialog box opens.

  2. Click the @REPLACE Function category in the left pane.

    The following image shows the Project Properties dialog box with the @REPLACE Functions category selected in the left pane.

    The Input Lookup and JDBC Lookup tabs contain the lists for the two types of replace functions available in Transformer.

  3. To define the replace functions in which you define the permanent or constant match and replace values, click the Input Lookup tab. For more information, see How to Define an Input Lookup.

    To define replace functions in which the match and replace values are taken from the columns of the specified database table, enabling you to insert the input values from the different databases, use the JDBC Lookup tab. For information, see Configuring Properties for JDBC Replace Functions.


Top of page

x
Procedure: How to Define an Input Lookup

To define an input lookup for a replace function:

  1. Click New in the Input Lookup tab.

    The Add New Input Lookup dialog box opens.

  2. Type a name, for example, Mammals, for the new input lookup group.

    The name Input is supplied by default.

  3. Click New.

    The Add New Input Lookup dialog box opens.

  4. Specify the match and replace values in the corresponding fields accordingly.
  5. Click OK.

    You are returned to the previous Add New Input Lookup dialog box.

    You can add multiple input lookups if required.

    For example, the following image shows a replace function named "Mammals." The lower pane of the Add New Input Lookup dialog box has columns for Match and Replace node values for various mammals, for example, “cow” to "bovine.”


Top of page

x
Procedure: How to Modify an Input Lookup

To modify an input lookup:

  1. Select the input lookup, for example, Mammals, and click Properties.

    The Input Lookup Properties dialog box opens.

    You can perform either one of the following modifications to an input lookup group:

    • Define additional match and replace pairings by clicking New.
    • Delete an existing match and replace pairing by selecting it and clicking Delete.
    • Modify the values of an existing match and replace pairing by selecting it and clicking Properties.
    • Change the order of a match and replace pairing by selecting it and clicking the up or down arrows located on the right side of the dialog box.
  2. Click OK once you have completed making the necessary modifications.

Top of page

x
Procedure: How to Delete an Input Lookup

To delete an input lookup:

  1. Select the input lookup, for example, Mammals, and click Delete.

    The following confirmation dialog box opens.

  2. Click Yes.

    The input lookup is removed from the list.


iWay Software