SlideShare a Scribd company logo
How to use DataMapper
Transformer
12-12-2014
Abstract
• The main motto of this PPT is How to use
DataMapper Transformer in our applications.
Introduction
• DataMapper takes data in a specific format
and outputs the same data in the format of
your choice.
Example
How to use data mapper transformer
How to use data mapper transformer
How to use data mapper transformer
.mflow
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">
<spring:beans>
<spring:bean id="Bean1" name="Bean" class="org.enhydra.jdbc.standard.StandardDataSource">
<spring:property name="driverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<spring:property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=test1;user=****;password=****;"/>
</spring:bean>
</spring:beans>
<jdbc-ee:connector name="Database" dataSource-ref="Bean1" validateConnections="true" queryTimeout="-1" pollingFrequency="0"
doc:name="Database"/>
<data-mapper:config name="new_mapping_grf" transformationGraphPath="new_mapping.grf" doc:name="new_mapping_grf"/>
<flow name="DataMapper_POCFlow1" doc:name="DataMapper_POCFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8088" path="datamapper" doc:name="HTTP"/>
<logger message="--entered" level="INFO" doc:name="Logger"/>
<jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database"
doc:name="Database">
<jdbc-ee:query key="select" value="select * from mytable"/>
</jdbc-ee:outbound-endpoint>
<data-mapper:transform config-ref="new_mapping_grf" doc:name="DataMapper"/>
<logger message="---#[payload]" level="INFO" doc:name="Logger"/>
</flow>
</mule>
• Output:
INFO 2015-12-12 06:28:28,567 [main] org.mule.DefaultMuleContext:
**********************************************************************
* Application: DataMapper_POC *
* OS encoding: Cp1252, Mule encoding: UTF-8 *
* *
* Agents Running: *
* Clustering Agent *
* JMX Agent *
**********************************************************************
INFO 2015-12-12 06:28:28,568 [main] org.mule.module.launcher.MuleDeploymentService:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Started app 'DataMapper_POC' +
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
INFO 2015-12-12 06:28:39,973 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --entered
INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.1295829687'. Object is:
EEJdbcMessageDispatcher
INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.1295829687'. Object is:
EEJdbcMessageDispatcher
INFO 2015-12-12 06:28:41,756 [[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: ---[{id=1, name=Ramesh, subj=Hindi, marks=55}, {id=2,
name=Mahesh, subj=English, marks=65}, {id=3, name=Pavan, subj=science, marks=75}, {id=4, name=Siva, subj=social,
marks=45}]
• Flow of execution:
1. URL to trigger the service from browser
http://localhost:8088/datamapper
2. Database component connects to the specific
database, executes the select query, maps the
results using DataMapper and prints the result
in console
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.7/datamapper-supplemental-topics

More Related Content

PPTX
How to use data mapper transformer
PPTX
PPTX
PPTX
How to use data weave
PPTX
How to use bean as datasource in database connector
PPTX
Database Component
PPTX
Wildcard Filter
PPTX
Database component in mule
How to use data mapper transformer
How to use data weave
How to use bean as datasource in database connector
Database Component
Wildcard Filter
Database component in mule

What's hot (11)

PPTX
How to use wildcard filter
PPTX
How to use message properties component
PPTX
Message properties component in Mule
PPTX
Message properties component in mule
PPTX
Bean as Datasource
PPTX
PPT
Java Developers, make the database work for you (NLJUG JFall 2010)
PPT
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
PDF
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
PDF
Qtp important frameworks
PPTX
My sql performance
How to use wildcard filter
How to use message properties component
Message properties component in Mule
Message properties component in mule
Bean as Datasource
Java Developers, make the database work for you (NLJUG JFall 2010)
Drupal 7 Feeds Intro Drupal Camp Indianapolis 2011
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 2...
Qtp important frameworks
My sql performance
Ad

Viewers also liked (13)

DOCX
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
PPTX
Someone-Who is it from-
PPTX
How to use expression filter
PPTX
How to use rest component
PPTX
Walt disney
PDF
Introducción a dropbox
PPTX
How to use and filter
PDF
PPTX
How to use splitter component
DOCX
TeamReport. FINAL
PPTX
Brady Swift - For the Patriot in all of us - for HIST 214
PPTX
Someone Update Flow Chart
PPTX
How to use not filter
Elyse Sydney Kaysha This Is My Penis After All Fall 2015
Someone-Who is it from-
How to use expression filter
How to use rest component
Walt disney
Introducción a dropbox
How to use and filter
How to use splitter component
TeamReport. FINAL
Brady Swift - For the Patriot in all of us - for HIST 214
Someone Update Flow Chart
How to use not filter
Ad

Similar to How to use data mapper transformer (20)

PPTX
Collection aggregator
PPTX
Mule Message Properties Component
PPTX
Expression Filters
PPTX
How to use message properties component
ODP
Howtouseforeachcomponent
PPTX
How to use message properties component
PPTX
How to use message properties component
PPTX
How to use message properties component
PPTX
Property place holder
PPTX
Message properties component in mule demo
PPTX
Specifying a default exception strategy
PPTX
Defining global exception strategies
PPTX
How to use message properties component
PPTX
How to use message properties component
PPTX
How to use message properties component
PPTX
Message properties component
 
PPTX
Message properties component
PPTX
Expression filter in Mule
PPTX
Message properties component in mule
PPTX
How to use expression filter
Collection aggregator
Mule Message Properties Component
Expression Filters
How to use message properties component
Howtouseforeachcomponent
How to use message properties component
How to use message properties component
How to use message properties component
Property place holder
Message properties component in mule demo
Specifying a default exception strategy
Defining global exception strategies
How to use message properties component
How to use message properties component
How to use message properties component
Message properties component
 
Message properties component
Expression filter in Mule
Message properties component in mule
How to use expression filter

More from RaviRajuRamaKrishna (7)

PPTX
Mock component in munit
PPTX
Jms selector
PPTX
PPTX
Object store
PPTX
How to use soap component
PPTX
How to use salesforce cloud connector
PPTX
How to use or filter
Mock component in munit
Jms selector
Object store
How to use soap component
How to use salesforce cloud connector
How to use or filter

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PPTX
GDM (1) (1).pptx small presentation for students
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
master seminar digital applications in india
PDF
RMMM.pdf make it easy to upload and study
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Basic Mud Logging Guide for educational purpose
Cell Types and Its function , kingdom of life
GDM (1) (1).pptx small presentation for students
STATICS OF THE RIGID BODIES Hibbelers.pdf
Institutional Correction lecture only . . .
Final Presentation General Medicine 03-08-2024.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Sports Quiz easy sports quiz sports quiz
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Anesthesia in Laparoscopic Surgery in India
102 student loan defaulters named and shamed – Is someone you know on the list?
human mycosis Human fungal infections are called human mycosis..pptx
Supply Chain Operations Speaking Notes -ICLT Program
master seminar digital applications in india
RMMM.pdf make it easy to upload and study
TR - Agricultural Crops Production NC III.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Basic Mud Logging Guide for educational purpose

How to use data mapper transformer

  • 1. How to use DataMapper Transformer 12-12-2014
  • 2. Abstract • The main motto of this PPT is How to use DataMapper Transformer in our applications.
  • 3. Introduction • DataMapper takes data in a specific format and outputs the same data in the format of your choice.
  • 8. .mflow <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd"> <spring:beans> <spring:bean id="Bean1" name="Bean" class="org.enhydra.jdbc.standard.StandardDataSource"> <spring:property name="driverName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> <spring:property name="url" value="jdbc:sqlserver://localhost:1433;databaseName=test1;user=****;password=****;"/> </spring:bean> </spring:beans> <jdbc-ee:connector name="Database" dataSource-ref="Bean1" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/> <data-mapper:config name="new_mapping_grf" transformationGraphPath="new_mapping.grf" doc:name="new_mapping_grf"/> <flow name="DataMapper_POCFlow1" doc:name="DataMapper_POCFlow1"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8088" path="datamapper" doc:name="HTTP"/> <logger message="--entered" level="INFO" doc:name="Logger"/> <jdbc-ee:outbound-endpoint exchange-pattern="request-response" queryKey="select" queryTimeout="-1" connector-ref="Database" doc:name="Database"> <jdbc-ee:query key="select" value="select * from mytable"/> </jdbc-ee:outbound-endpoint> <data-mapper:transform config-ref="new_mapping_grf" doc:name="DataMapper"/> <logger message="---#[payload]" level="INFO" doc:name="Logger"/> </flow> </mule>
  • 9. • Output: INFO 2015-12-12 06:28:28,567 [main] org.mule.DefaultMuleContext: ********************************************************************** * Application: DataMapper_POC * * OS encoding: Cp1252, Mule encoding: UTF-8 * * * * Agents Running: * * Clustering Agent * * JMX Agent * ********************************************************************** INFO 2015-12-12 06:28:28,568 [main] org.mule.module.launcher.MuleDeploymentService: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Started app 'DataMapper_POC' + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ INFO 2015-12-12 06:28:39,973 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --entered INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher INFO 2015-12-12 06:28:39,981 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher INFO 2015-12-12 06:28:41,756 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: ---[{id=1, name=Ramesh, subj=Hindi, marks=55}, {id=2, name=Mahesh, subj=English, marks=65}, {id=3, name=Pavan, subj=science, marks=75}, {id=4, name=Siva, subj=social, marks=45}]
  • 10. • Flow of execution: 1. URL to trigger the service from browser http://localhost:8088/datamapper 2. Database component connects to the specific database, executes the select query, maps the results using DataMapper and prints the result in console