SlideShare a Scribd company logo
1 of 8
How to use DataMapper
Transformer
16-05-2015
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
.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="8065" 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:
+++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++
+ Started app 'DataMapper' +
+++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++
INFO 2015-05-16 10:00:00,123
[[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: --entered
INFO 2015-05-16 10:00:00,123
[[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Initialising:
'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher
INFO 2015-05-16 10:00:00,123
[[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.lifecycle.AbstractLifecycleManager: Starting:
'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher
INFO 2015-05-16
10:00:00,254[[DataMapper_POC].connector.http.mule.default.receiver.02]
org.mule.api.processor.LoggerMessageProcessor: ---[{id=1, name=a, subj=Hindi,
marks=34}, {id=2, name=b, subj=English, marks=33}, {id=3, name=c,
subj=science, marks=67}, {id=4, name=d, subj=social, marks=89}]
 Flow of execution:
1. URL to trigger the service from browser
http://localhost:8065/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

What's hot (6)

Database Component
Database ComponentDatabase Component
Database Component
 
How to use bean as datasource in database connector
How to use bean as datasource in database connectorHow to use bean as datasource in database connector
How to use bean as datasource in database connector
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
 
How to use not filter
How to use not filterHow to use not filter
How to use not filter
 
Database connectivity in ci
Database connectivity in ciDatabase connectivity in ci
Database connectivity in ci
 

Viewers also liked

shaikh aleem ahmed
shaikh aleem ahmedshaikh aleem ahmed
shaikh aleem ahmed
indianwhc
 
ерөнхий мэдлэгийн тест 11-р анги
ерөнхий мэдлэгийн тест 11-р ангиерөнхий мэдлэгийн тест 11-р анги
ерөнхий мэдлэгийн тест 11-р анги
Ganbat Narantsetseg
 
Naslednost i variranje osobina kod ljudi i nasledne bolesti čoveka
Naslednost i variranje osobina kod ljudi i nasledne bolesti čovekaNaslednost i variranje osobina kod ljudi i nasledne bolesti čoveka
Naslednost i variranje osobina kod ljudi i nasledne bolesti čoveka
Adisboss
 
утицај средине на изазивање наследних промена
утицај средине на изазивање наследних променаутицај средине на изазивање наследних промена
утицај средине на изазивање наследних промена
Adisboss
 
С.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМ
С.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМС.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМ
С.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМ
batnasanb
 
8 Arts and Entertaiment
8 Arts and Entertaiment8 Arts and Entertaiment
8 Arts and Entertaiment
Martina Baca
 

Viewers also liked (13)

shaikh aleem ahmed
shaikh aleem ahmedshaikh aleem ahmed
shaikh aleem ahmed
 
Ravi_Nelluri_QA
Ravi_Nelluri_QARavi_Nelluri_QA
Ravi_Nelluri_QA
 
How to use for each component
How to use for each componentHow to use for each component
How to use for each component
 
LOGAN
LOGANLOGAN
LOGAN
 
ерөнхий мэдлэгийн тест 11-р анги
ерөнхий мэдлэгийн тест 11-р ангиерөнхий мэдлэгийн тест 11-р анги
ерөнхий мэдлэгийн тест 11-р анги
 
LED reflektor 70W teplá bílá
LED reflektor 70W teplá bíláLED reflektor 70W teplá bílá
LED reflektor 70W teplá bílá
 
I parassiti intestinali del cane
I parassiti intestinali del caneI parassiti intestinali del cane
I parassiti intestinali del cane
 
Concept symposia 2017
Concept symposia 2017Concept symposia 2017
Concept symposia 2017
 
BREAK - Basic Real Estate - A Knowledge
BREAK - Basic Real Estate - A KnowledgeBREAK - Basic Real Estate - A Knowledge
BREAK - Basic Real Estate - A Knowledge
 
Naslednost i variranje osobina kod ljudi i nasledne bolesti čoveka
Naslednost i variranje osobina kod ljudi i nasledne bolesti čovekaNaslednost i variranje osobina kod ljudi i nasledne bolesti čoveka
Naslednost i variranje osobina kod ljudi i nasledne bolesti čoveka
 
утицај средине на изазивање наследних промена
утицај средине на изазивање наследних променаутицај средине на изазивање наследних промена
утицај средине на изазивање наследних промена
 
С.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМ
С.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМС.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМ
С.ЭНХТУЯА - ХЭРЭГЛЭГЧТЭЙ ХАРИЛЦАХ УДИРДЛАГЫН СИСТЕМ
 
8 Arts and Entertaiment
8 Arts and Entertaiment8 Arts and Entertaiment
8 Arts and Entertaiment
 

Similar to How to use data mapper transformer

Similar to How to use data mapper transformer (20)

Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Expression Filters
Expression FiltersExpression Filters
Expression Filters
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Property place holder
Property place holderProperty place holder
Property place holder
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Filter expression in mule demo
Filter expression in mule demoFilter expression in mule demo
Filter expression in mule demo
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use data weave
How to use data weaveHow to use data weave
How to use data weave
 
Expression
ExpressionExpression
Expression
 
Choice component in mule demo
Choice component in mule demoChoice component in mule demo
Choice component in mule demo
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
How to use expression filter
How to use expression filterHow to use expression filter
How to use expression filter
 
Expression filter in Mule
Expression filter in MuleExpression filter in Mule
Expression filter in Mule
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 
How to use message properties component
How to use message properties componentHow to use message properties component
How to use message properties component
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

How to use data mapper transformer

  • 1. How to use DataMapper Transformer 16-05-2015
  • 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.
  • 5. .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="8065" 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>
  • 6.  Output: +++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++ + Started app 'DataMapper' + +++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++ INFO 2015-05-16 10:00:00,123 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: --entered INFO 2015-05-16 10:00:00,123 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher INFO 2015-05-16 10:00:00,123 [[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'Database.dispatcher.1295829687'. Object is: EEJdbcMessageDispatcher INFO 2015-05-16 10:00:00,254[[DataMapper_POC].connector.http.mule.default.receiver.02] org.mule.api.processor.LoggerMessageProcessor: ---[{id=1, name=a, subj=Hindi, marks=34}, {id=2, name=b, subj=English, marks=33}, {id=3, name=c, subj=science, marks=67}, {id=4, name=d, subj=social, marks=89}]
  • 7.  Flow of execution: 1. URL to trigger the service from browser http://localhost:8065/datamapper 2. Database component connects to the specific database, executes the select query, maps the results using DataMapper and prints the result in console