Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

The Data Mapping View

Version 3.3.1 only

This document provides an overview of Studio’s graphical data mapping editor, Anypoint DataMapper (referred to as DataMapper from this point on).

This document assumes the reader is familiar with the Anypoint DataMapper Transformer. Consult the DataMapper Transformer Reference document for details.

Displaying the Graphical Mapping Editor

To see the graphical mapping editor, double-click the DataMapper building block in the Mule Studio canvas. Studio highlights the Data Mapping tab and displays the editor (see image below).

01

Overview of the Graphical Mapping Editor

The image below describes the different icons, indicators and tools in DataMapper’s graphical mapping editor. For a description of each item, consult the numbered table below the image.

2-4

Number Description

1

Input pane Add element icon. Click to add elements to the mapping, including:

  • Rules

  • Input Arguments

  • Lookup tables

1-add_element

2

Input pane Properties icon. Click to edit properties for the input data.

2-input_properties

3

Input pane Search Filter. Type a string to display only elements in the input data that contain the string.

3-input_type_filter_text

4

Input pane Expand all and Collapse all buttons. Click to expand or collapse all elements in the input pane.

4-input_expand-collapse_all

5

Input pane Eye icon. Default position is closed.

  • When closed,eye_closed hides all elements in the input pane that are not mappable in the currently displayed mapping level. (To display different mapping levels, see item 6.)

  • When open, eye_open displays all elements in the input mapping pane that are not collapsed, whether or not you can map them in the current mapping level.

5-input_eye_open

6

Current Element Mapping indicator/drop-down menu. Indicates the currently-displayed mapping level for multiple-level data mappings such as nested lists. The drop-down menu allows you to instantly switch between mapping levels. The screenshots below illustrate the respective displays of two mapping levels. Note that the solid, dotted, and greyed-out arrows change to reflect the mappings Mule defines for the selected mapping level.

contacts_to_user:

6.example

emergencyContacts_to_User:

6.example2

7

Add Mapping icon: Click to add a new mapping. DataMapper displays the Structure mapping editor pop-up dialogue (see image below).

In the Name field, type a descriptive name for the new mapping.

In the Condition field, type an XPath condition that should be met by the structure being mapped. The condition will filter the selected source.

7.example

8

The Edit Mapping icon. Click to open the Structure Mapping Editor.

8.example

Click Advanced Mapping Editor to access DataMapper’s advanced editor. For a detailed explanation of Advanced Mapping Editor, consult DataMapper Transformer Reference.

8.example2

9

Remove mapping icon. Click to remove the currently displayed mapping.

10

Output pane Clear field assignment icon. Click to remove the script assigned to a field in the output mapping. To see the script for a field, click the field. DataMapper displays the script in the editor below the output pane. For example, in the screenshot below, the name field’s script is $in.0.name;.

10.example

11

Output pane Properties icon. Click to edit properties for the output data. Identical to the input pane Properties icon (see item 2 in this table).

12

Output pane Search Filter. Type a string to display only elements in the output data that contain the string. Identical to the input pane search filter (see item 3 in this table).

13

Output pane Undo icon. Click to undo your last action in DataMapper.

14

Output pane Redo icon. Click to redo your last action in DataMapper.

15

DataMapper Properties icon. Click to display, and optionally edit, properties for the DataMapper building block.

15.example

16

The Eye icon for the Output pane. Its behavior is identical to the Eye icon in the Input pane. See item 5 in this table.

17

Output pane Expand all and Collapse all buttons. Click to expand or collapse all elements in the output pane.

18

Output Mapping Fields. Studio indicates mapped fields in bold, and unmapped fields in italics. In the screenshot below, DataMapper maps the name and lastname fields, while phone is not. Click a mapped field to display its assigned script in the textbox under the Output pane. You can edit the assigned script directly in the textbox, or click the open_scrip_editor icon (highlighted below, left) to open the Expression Editor (below, right).

side-by-side_properties

19

Mapping arrows.

Mapping arrows are black if the graphical editor is currently displaying the arrows' mapping level. (For a details on selecting mapping levels, see item 6 in this table.)

  • a solid arrow indicates a valid mapping in the current mapping level

  • a dotted arrow indicates a top-level mapping, such as a mapping between two nested lists

  • a greyed-out arrow indicates a mapping for another mapping level

20

Input pane controls for adding Input arguments, Rules or Lookup tables. Right-click the appropriate control to add an element to the input data (see image below).

Input arguments enable you to include dynamic information, such as the output of Mule variables or functions in your mapping. Consult Using Input Arguments for details.

Rules enable you to dynamically define mappings based on properties of the input data. For a detailed explanation of rules, consult the XPATH Mapping section of the DataMapper Transformer Reference page.

Lookup tables facilitate mappings from one value to another on the basis of lookup table definitions. For details consult the Lookup Tables section of the DataMapper Transformer Reference page.

20-3.example

21

Preview tab. Click to obtain a preview of your mapping. Consult Obtaining a Preview of Mapped Data for details.

22

Mappings tab, as described in this document. While in the Preview tab, click to display the graphical mapping editor.