If instruction

This section describes how to:

You can use the if instruction to check whether a given condition is satisfied before applying a link between a source element and a target element. In all, there are in all four elements involved:

  • The source element of the link, in the left panel
  • The target element of the link, in the right panel
  • The link between the source and the target, represented by an element in the central panel, and its connections to the source and target elements
  • The condition element, in the left panel, which is connected by a dotted line to the link element in the central panel

Visual Mapper checks whether the condition is satisfied (by default, whether the condition element is not empty) before mapping the source element to the target element.

To apply the if instruction:

  1. Select the If icon from the palette on the right
  2. Select the condition element (left panel), then drag and drop it on a link element (central panel)
    Or you can replace steps 1 and 2 by Right-click on the link element > Set function > If
  3. (Optional) You can then double-click on the link element,
    (or right-click the link element, then select Edit... ).
  4. The Edit If dialog box appears, it contains two parameters: condition (the condition element) and input (the source element)

You can change the condition element before you execute the map, by reconnecting the dotted line to a different element on the left panel, or by editing the condition parameter in the Edit IF dialog. In the Properties view you can see the generated XSL expression. See Properties view.

Note   You can configure complex expressions for conditions in the parameter dialog; however, there is no validation of the input, and the existing links will be removed from UI.

Visual Mapper Apply the if instruction to a sample link example

To apply the if instruction to a structural link, you can either use the drag-and-drop method described above (in Apply the if instruction to a simple link), or you can right-click on the link element in the central panel and use the contextual menu.

You can also change the condition element, as described above.

Example of using the if instruction

In following example, the account structure is mapped only if the currency is EUR:

Visual Mapper if instruction to a structural link example



Related Links