Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Mulesoft Data Mapper

DZone's Guide to

Mulesoft Data Mapper

This quick article gets you started up with DataMapper and shows how to configure an instance of DataMapper in your flow.

· Integration Zone
Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

First of all, the latest Anypoint Studio doesn’t work with tools like DataMapper. Instead, Anypoint has come up with a tool like Transformation, but then Anypoint allows you to work with the tools which have already been deprecated. So for this connector to show up you need to go to Window > Preferences > Anypoint Studio > Palette Profiles and then on the right side select the runtime(s) and click the box labeled 'Show deprecated Mule components and attributes'.

Now on to the use of Data Mapper. Anypoint DataMapper takes data in a specific format and outputs the same data in the format of your choice. For example, you can take data stored as XML and output the same data in JSON format.

Both the input and the output can be in any of the formats supported by Mule:

"Flat," row-oriented formats:

  • CSV

  • Fixed-width

  • MS Excel sheets

Structured formats:

  • XML

  • JSON

  • POJO object trees

  • Key-value Maps

You configure DataMapper using its GUI, called the graphical mapping editor. This editor has two panes: an Input pane and an Output pane, where you define your input metadata (format, names of fields, etc.) and your output metadata respectively.

Basic Usage

Let’s start with some basic usage of DataMapper:

Configuring an instance of DataMapper in your flow involves several high-level steps:

  1. Insert a DataMapper transformer at the desired location in your application flow.

  2. Tell DataMapper what comes in and what comes out.

    Image title

  3. Click Create mapping to create an initial data mapping. DataMapper will automatically map corresponding fields between the input and output data and will leave any other fields unmapped.

  4. If necessary, graphically modify the mapping, defining input elements and attributes to output elements and attributes:

Image title

With the above article, one can start up with DataMapper and get a little clue about what this connector is all about. We just need to manually match the connectors on both the input and output sides. However, values with the same name are sensed by Data Mapper itself and are mapped automatically.

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:
data mapper ,mulesoft studio ,anypoint platform ,mule

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}