Show TOC

Procedure documentationUsing Expression Editor for Mappings Locate this document in the navigation structure

 

You use this procedure for assigning an expression to target operation using the expression editor. Expressions describe the flow of data from source field to target field.

The expression editor comprises of an editor window in which you can insert functions for mapping source and target fields.

Procedure

  1. In the Definition tab page double-click on the target node for which you want to assign expression.

  2. In the expression editor window, you can assign a string literal as an expression to the target node by giving string inside the double quotes.

    Example Example

    concat(a/b/b1,a/c/c1,”###”)

    In the above example “###” is the string literal inside quotes.

    End of the example.
  3. Assign the source node Xpath as an expression by using either of the following ways:

    • From the Context folder on the right-hand side of the expression editor, expanding the folder, and double-clicking on the node.

      Note Note

      You can also drag and drop the node to the text area of the expression editor.

      End of the note.
    • You can also use Ctrl and space to list the root node of the source structure.

      Note Note

      You can display all the immediate children node of the root element by selecting the root node and appending with “/” , type the first letter of the next child element of the root, then press ctrl and space. Similarly the hierarchy for the other node follows.

      End of the note.
  4. You can add a function to the expression by using the Functions folder on the right-hand side of the editor window.

    Note Note

    • Functions folder displays the list of all the category of the functions and each category contains the functions name along with its signature and tool tip description.

    • Any function can be selected from the list by dragging and dropping on the left hand panel or by double-clicking on the function name.

    • For functions category refer to the Standard Functions documentation.

    • If any user-defined functions are present , then Usernamespace category is created and the function gets added under this category.

      You can choose your user defined function from this folder. Functions in a function library are grouped by the instance name defined for a function library in the dependencies page

      For more information on user defined functions refer to Local functions

    End of the note.

    Example Example

    This example is to help you understand how functions can be assigned to an expression:

    concat (“Argument”, ”Argument” ,”parameter”)

    The above selected function has three fields, the first two fields can take argument and the last field takes parameter.

    End of the example.

    Note Note

    1. If any function accepts “parameter” then it can be distinguished from argument by looking into function tooltip (by hovering over the function ), if any argument name follows ”(parameter)” text it signifies that the argument takes “parameter” values.

    2. If you passing an argument to the function then:

      • You can pass another function, a node Xpath and even a string literal or constant as value to the argument.

        Example Example

        concat(a/b/b1,a/c/c1,”###”)

        End of the example.
        • You can also use, Ctrl and space at the required position.

          Example Example

          concat(add(1,30),const(“constant”),a/b/b1,”$$”)

          End of the example.

          Note Note

          In order to use ctrl and space effectively, make the expression parse error free.

          End of the note.
    3. If you passing an parameter to the function then:

      • Parameter values could be any string constant and the values must be given inside double quotation.

        Example Example

        concat(a/b/b1,a/c/c1,”###”)

        End of the example.
      • Some functions take the parameter declared under the Parameter section in the Overview page. In order to use these parameters declared , param function, listed under Adapter category under “Function” folder is used

        Example Example

        concat(a/b, a/c/c1,param(“param1”)),

        param1 is the parameter declared.

        End of the example.
      • If you use Ctrl and space inside the double quotes of the “param” function, the parameter of category “Simple type” declared in the parameter section gets listed.

      • Some function takes the pre-declared value for the parameters, and using ctrl and space inside the double quotes lists the predefined values available (if any) for the parameter position.

        Example Example

        currentDate("yyyy/MM/dd", "Thursday", "1", "true")

        In the above function if you go to the second parameter that is, ”Thursday” and use ctrl and space inside the double quotes, all the values applicable to that field gets listed.

        End of the example.

        Note Note

        Expression with errors are not saved.

        End of the note.
    End of the note.
  5. Select OK after assigning the expression for the target node.