SlideShare a Scribd company logo
1 of 13
CSV to XML transformation in Mule
Today we will be discussing on transformation
of CSV to XML format of data.
The configuration details for each of the Mule flow
component is explained below.
The first component of the flow is File Endpoint.
The File endpoint is configured to pick up files from specific
location and on completion of processing move it to a pre-
defined location. The developer is free to choose location as
per his/her convenience.
For our demonstration, in the General tab, configure the
following
Path –
C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs
vtoxmlsrctestresourcesinput
Move to Directory – C:MuleStudioFileOutbound g
properties with specified values:
Move to Directory –
C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs
vtoxmlsrctestresourcesoutput
The next component is logger. The message property value of
the logger component defines the logging statement. In the
General tab, configure the following.
Message – #[string: output #[message]]
The message object provides developer with insights
regarding message’s meta-data.
The contents of the file read by the File endpoint component
is passed to the CSV to Maps component for conversion to
Map data structure. Each line in the CSV file is converted into
an individual Map instance. The individual Map instances are
added to a Collection and passed on to the next message
processor in the flow chain. The component
uses FlatPack project to do file parsing. The parsed file
definition is provided via the mapping file property. The file
needs to be present in the application classpath. To ensure
availability, the person.xml is added in the src/main/java
folder.
In the General tab of the CSV to Maps component configure
the following properties with specific values
Delimiter – ,
Mapping file – person.xml
<?xml version='1.0'?>
<!-- DTD can be pulled from the Jar or over the web-->
<!DOCTYPE PZMAP SYSTEM "flatpack.dtd" >
<!--<!DOCTYPE PZMAP SYSTEM
"http://flatpack.sourceforge.net/flatpack.dtd" >-->
<PZMAP>
<COLUMN name="FIRSTNAME" />
<COLUMN name="LASTNAME" />
<COLUMN name="DOB" />
</PZMAP>
In the Java component’s General tab configure the
following property with specific value.
Class Name – com.vinraj.integration.file.CSVProcessor
The source code of the CSVProcessor is shown below.
package testcsvtoxml;
import java.util.List;
import java.util.Map;
public class CSVProcessor {
public void processFile(List<Map<String, String>> maps) {
System.out.println(maps);
System.out.println("Size: " + maps.size());
}
}
For testin we can use into csv
John,Kent,11/02/1972
Jane,Tully,1/12/1978
Robert,Smith,1/12/1988
Message properties:
INVOCATION scoped properties:
fileAge=1000
moveToDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtox
mlsrctestresourcesoutput
originalDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxm
INBOUND scoped properties:
MULE_ORIGINATING_ENDPOINT=endpoint..C.Users.antonio.pellegrino.AnypointStudio
.workspace.testcsvtoxml.src.test.resources.input
directory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxmlsrctes
tresourcesinputlsrctestresourcesinput originalFilename=person.csv
originalFilename=person.csv
fileSize=66
originalDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxm
lsrctestresourcesinput
originalFilename=person.csv
timestamp=1464105815396
OUTBOUND scoped properties:
filename=person.csv
SESSION scoped properties:
}
[{FIRSTNAME=John, DOB=11/02/1972, LASTNAME=Kent}, {FIRSTNAME=Jane,
DOB=1/12/1978, LASTNAME=Tully}, {FIRSTNAME=Robert, DOB=1/12/1988,
LASTNAME=Smith}]
Size: 3
The graphic flow is

More Related Content

What's hot

File connector
File connectorFile connector
File connectorThang Loi
 
File Connector
File ConnectorFile Connector
File ConnectorThang Loi
 
Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008ChemAxon
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Modelkunj desai
 
Mule xml to-jaxb object
Mule xml to-jaxb objectMule xml to-jaxb object
Mule xml to-jaxb objectAnkush Sharma
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traceskunal vishe
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Pooja Talreja
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functionsAmrit Kaur
 
5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow BasicsPramod Singla
 
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow TasksPramod Singla
 
Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Dr. Krishna Mohbey
 
SQL Server Database Migration
SQL Server Database MigrationSQL Server Database Migration
SQL Server Database MigrationZeba Ansari
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshStrawhatLuffy11
 

What's hot (20)

File connector
File connectorFile connector
File connector
 
File Connector
File ConnectorFile Connector
File Connector
 
Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008Pipelining Chem Axon: US UGM 2008
Pipelining Chem Axon: US UGM 2008
 
Ftp connector
Ftp connectorFtp connector
Ftp connector
 
JDBC Connectivity Model
JDBC Connectivity ModelJDBC Connectivity Model
JDBC Connectivity Model
 
Lift Framework
Lift FrameworkLift Framework
Lift Framework
 
Mule Cache Scope
Mule Cache ScopeMule Cache Scope
Mule Cache Scope
 
Mule xml to-jaxb object
Mule xml to-jaxb objectMule xml to-jaxb object
Mule xml to-jaxb object
 
Mule debugging managing_stack_traces
Mule debugging managing_stack_tracesMule debugging managing_stack_traces
Mule debugging managing_stack_traces
 
Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)Java Database Connectivity (JDBC)
Java Database Connectivity (JDBC)
 
Set path
Set pathSet path
Set path
 
5. stored procedure and functions
5. stored procedure and functions5. stored procedure and functions
5. stored procedure and functions
 
5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics5\9 SSIS 2008R2_Training - DataFlow Basics
5\9 SSIS 2008R2_Training - DataFlow Basics
 
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
3.2\9 SSIS 2008R2_Training - ControlFlow Tasks
 
Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1Manit bhopal group_1_latex_assignment_part_2-1
Manit bhopal group_1_latex_assignment_part_2-1
 
Graduate Project Summary
Graduate Project SummaryGraduate Project Summary
Graduate Project Summary
 
Jdbc 2
Jdbc 2Jdbc 2
Jdbc 2
 
SQL Server Database Migration
SQL Server Database MigrationSQL Server Database Migration
SQL Server Database Migration
 
Fsmo roles
Fsmo rolesFsmo roles
Fsmo roles
 
Easy Dataweave transformations - Ashutosh
Easy Dataweave transformations - AshutoshEasy Dataweave transformations - Ashutosh
Easy Dataweave transformations - Ashutosh
 

Viewers also liked

Topic7.2 a_benefit and service
Topic7.2 a_benefit and serviceTopic7.2 a_benefit and service
Topic7.2 a_benefit and servicetellstptrisakti
 
Estado, política y sociedad.
Estado, política y sociedad.Estado, política y sociedad.
Estado, política y sociedad.elio salaverria
 
Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]jeraldin-camelo
 
Topic7.2 c_benefit and service
Topic7.2 c_benefit and serviceTopic7.2 c_benefit and service
Topic7.2 c_benefit and servicetellstptrisakti
 
El Fenomeno Comunicativo
El Fenomeno ComunicativoEl Fenomeno Comunicativo
El Fenomeno Comunicativojuanelo01
 
Topic7 2 e_benefit and service
Topic7 2 e_benefit and serviceTopic7 2 e_benefit and service
Topic7 2 e_benefit and servicetellstptrisakti
 
funcinamiento de una computadora
funcinamiento de una computadorafuncinamiento de una computadora
funcinamiento de una computadoraRosita Condoy
 
Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism Eric Ortiz
 

Viewers also liked (11)

Topic7.2 a_benefit and service
Topic7.2 a_benefit and serviceTopic7.2 a_benefit and service
Topic7.2 a_benefit and service
 
Estado, política y sociedad.
Estado, política y sociedad.Estado, política y sociedad.
Estado, política y sociedad.
 
Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]Hardware y software 1trabajo 1[1]
Hardware y software 1trabajo 1[1]
 
Topic7.2 c_benefit and service
Topic7.2 c_benefit and serviceTopic7.2 c_benefit and service
Topic7.2 c_benefit and service
 
El Fenomeno Comunicativo
El Fenomeno ComunicativoEl Fenomeno Comunicativo
El Fenomeno Comunicativo
 
V&R Inc_Corporate Brochure
V&R Inc_Corporate BrochureV&R Inc_Corporate Brochure
V&R Inc_Corporate Brochure
 
Topic7 2 e_benefit and service
Topic7 2 e_benefit and serviceTopic7 2 e_benefit and service
Topic7 2 e_benefit and service
 
HANA
HANAHANA
HANA
 
Un minuto(1)
Un minuto(1)Un minuto(1)
Un minuto(1)
 
funcinamiento de una computadora
funcinamiento de una computadorafuncinamiento de una computadora
funcinamiento de una computadora
 
Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism Evrybit: An All-in-One App for Journalism
Evrybit: An All-in-One App for Journalism
 

Similar to Transformation csvtoxml

Oaf development-guide
Oaf development-guideOaf development-guide
Oaf development-guide俊 朱
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To AntRajesh Kumar
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10kunal vishe
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1shiv_nj
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's GuideKeyur Shah
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpackNodeXperts
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGHitesh Mohapatra
 
Oracle RI ETL process overview.
Oracle RI ETL process overview.Oracle RI ETL process overview.
Oracle RI ETL process overview.Puneet Kala
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migrationAmit Sharma
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?Oliver Lemm
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake TutorialFu Haiping
 
Spotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creationSpotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creationAmbareesh Kulkarni
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension developmentvicccuu
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migrationAmit Sharma
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utilityAmit Sharma
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration Cloud Analogy
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utilityAmit Sharma
 

Similar to Transformation csvtoxml (20)

Oaf development-guide
Oaf development-guideOaf development-guide
Oaf development-guide
 
Introduction To Ant
Introduction To AntIntroduction To Ant
Introduction To Ant
 
Mule data weave_10
Mule data weave_10Mule data weave_10
Mule data weave_10
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
Oracle Endeca Developer's Guide
Oracle Endeca Developer's GuideOracle Endeca Developer's Guide
Oracle Endeca Developer's Guide
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDINGWORKING WITH FILE AND PIPELINE PARAMETER BINDING
WORKING WITH FILE AND PIPELINE PARAMETER BINDING
 
OMG D&C Tutorial
OMG D&C TutorialOMG D&C Tutorial
OMG D&C Tutorial
 
Oracle RI ETL process overview.
Oracle RI ETL process overview.Oracle RI ETL process overview.
Oracle RI ETL process overview.
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
 
How to use source control with apex?
How to use source control with apex?How to use source control with apex?
How to use source control with apex?
 
CMake Tutorial
CMake TutorialCMake Tutorial
CMake Tutorial
 
Spotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creationSpotfire Integration & Dynamic Output creation
Spotfire Integration & Dynamic Output creation
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
 
User and group security migration
User and group security migrationUser and group security migration
User and group security migration
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
 
Salesforce ANT migration
Salesforce ANT migration Salesforce ANT migration
Salesforce ANT migration
 
Force.com migration utility
Force.com migration utilityForce.com migration utility
Force.com migration utility
 
PPT_CC.pptx
PPT_CC.pptxPPT_CC.pptx
PPT_CC.pptx
 

More from Germano Barba

Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesbGermano Barba
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesbGermano Barba
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesbGermano Barba
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in muleGermano Barba
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connectorGermano Barba
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger componentGermano Barba
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger componentGermano Barba
 
Mule esb add logger to existing flow
Mule esb add logger to existing flowMule esb add logger to existing flow
Mule esb add logger to existing flowGermano Barba
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connectorGermano Barba
 

More from Germano Barba (15)

Mule esb lesson 3
Mule esb   lesson 3Mule esb   lesson 3
Mule esb lesson 3
 
Mule esb lesson 2
Mule esb   lesson 2Mule esb   lesson 2
Mule esb lesson 2
 
Mule esb lesson 1
Mule esb   lesson 1Mule esb   lesson 1
Mule esb lesson 1
 
Rest fullservices
Rest fullservicesRest fullservices
Rest fullservices
 
Transformation jsontojsonesb
Transformation jsontojsonesbTransformation jsontojsonesb
Transformation jsontojsonesb
 
Transformation jsontoxmlesb
Transformation jsontoxmlesbTransformation jsontoxmlesb
Transformation jsontoxmlesb
 
Transformation xmltoobjectesb
Transformation xmltoobjectesbTransformation xmltoobjectesb
Transformation xmltoobjectesb
 
Xml to xml transformation in mule
Xml to xml transformation in muleXml to xml transformation in mule
Xml to xml transformation in mule
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
 
Mule esb using file to string and logger component
Mule esb using file to string and logger componentMule esb using file to string and logger component
Mule esb using file to string and logger component
 
Mule hppt java
Mule hppt javaMule hppt java
Mule hppt java
 
Mule io flow
Mule io flowMule io flow
Mule io flow
 
Mule esb add logger to existing flow
Mule esb add logger to existing flowMule esb add logger to existing flow
Mule esb add logger to existing flow
 
Mule esb first http connector
Mule esb first http connectorMule esb first http connector
Mule esb first http connector
 

Recently uploaded

Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka DoktorováCzechDreamin
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024TopCSSGallery
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 

Recently uploaded (20)

Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024Top 10 Symfony Development Companies 2024
Top 10 Symfony Development Companies 2024
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 

Transformation csvtoxml

  • 1. CSV to XML transformation in Mule
  • 2. Today we will be discussing on transformation of CSV to XML format of data. The configuration details for each of the Mule flow component is explained below. The first component of the flow is File Endpoint.
  • 3. The File endpoint is configured to pick up files from specific location and on completion of processing move it to a pre- defined location. The developer is free to choose location as per his/her convenience. For our demonstration, in the General tab, configure the following Path – C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs vtoxmlsrctestresourcesinput Move to Directory – C:MuleStudioFileOutbound g properties with specified values:
  • 4. Move to Directory – C:Usersantonio.pellegrinoAnypointStudioworkspacetestcs vtoxmlsrctestresourcesoutput The next component is logger. The message property value of the logger component defines the logging statement. In the General tab, configure the following. Message – #[string: output #[message]] The message object provides developer with insights regarding message’s meta-data.
  • 5. The contents of the file read by the File endpoint component is passed to the CSV to Maps component for conversion to Map data structure. Each line in the CSV file is converted into an individual Map instance. The individual Map instances are added to a Collection and passed on to the next message processor in the flow chain. The component uses FlatPack project to do file parsing. The parsed file definition is provided via the mapping file property. The file needs to be present in the application classpath. To ensure availability, the person.xml is added in the src/main/java folder.
  • 6. In the General tab of the CSV to Maps component configure the following properties with specific values Delimiter – , Mapping file – person.xml
  • 7. <?xml version='1.0'?> <!-- DTD can be pulled from the Jar or over the web--> <!DOCTYPE PZMAP SYSTEM "flatpack.dtd" > <!--<!DOCTYPE PZMAP SYSTEM "http://flatpack.sourceforge.net/flatpack.dtd" >--> <PZMAP> <COLUMN name="FIRSTNAME" /> <COLUMN name="LASTNAME" />
  • 8. <COLUMN name="DOB" /> </PZMAP> In the Java component’s General tab configure the following property with specific value. Class Name – com.vinraj.integration.file.CSVProcessor The source code of the CSVProcessor is shown below.
  • 9. package testcsvtoxml; import java.util.List; import java.util.Map; public class CSVProcessor { public void processFile(List<Map<String, String>> maps) { System.out.println(maps); System.out.println("Size: " + maps.size()); } }
  • 10. For testin we can use into csv John,Kent,11/02/1972 Jane,Tully,1/12/1978 Robert,Smith,1/12/1988
  • 11. Message properties: INVOCATION scoped properties: fileAge=1000 moveToDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtox mlsrctestresourcesoutput originalDirectory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxm INBOUND scoped properties: MULE_ORIGINATING_ENDPOINT=endpoint..C.Users.antonio.pellegrino.AnypointStudio .workspace.testcsvtoxml.src.test.resources.input directory=C:Usersantonio.pellegrinoAnypointStudioworkspacetestcsvtoxmlsrctes tresourcesinputlsrctestresourcesinput originalFilename=person.csv
  • 13. [{FIRSTNAME=John, DOB=11/02/1972, LASTNAME=Kent}, {FIRSTNAME=Jane, DOB=1/12/1978, LASTNAME=Tully}, {FIRSTNAME=Robert, DOB=1/12/1988, LASTNAME=Smith}] Size: 3 The graphic flow is