SlideShare a Scribd company logo
1 of 12
Mule ESB – DataWeave - CopyBook
Flat file To JSON Conversion using Copybook Schema
Steps :
1) First configure the ‘HTTP’ connector as a source in Anypoint Studio Mule.
2) Drag & Drop the ‘Transform Message’ from the Mule palette window for
conversion.
3) In the Transform Message as input metadata provide copybook schema at the
same time as output metadata provide JSON Data. Because of Flatfile – JSON
conversion using copybook schema.
4) Drag & Drop ‘Byte Array to String’ Transformer from Mule Palette window for
converting result into string.
5) Finally use the Logger for logging the result message.
Note:
Find the Sample Copybook & JSON Data in the next slides.
Sample Copybook :
000000 01 HospitalsCopyBook.
000100 02 Hospitals.
000200 03 Basic-Info.
000300 05 Name PIC X(4).
000400 05 Address PIC XXXX.
000500 05 Phone-Number PIC 9(10).
000600 05 Admin PIC XXXX.
000700* Ward Information
000800 02 Wards.
000900 03 Basic-Info.
001000 05 Name PIC XXXX.
001100 05 Address PIC X(4).
001200 05 Number PIC 9999999999.
001300 05 Admin PIC X(4).
001400* Patient Information
001500 02 Patients.
001600 03 Basic-Info.
001700 05 Name PIC XXXX.
001800 05 Address PIC X(4).
001900 05 Phone-Number PIC 9(10).
002000 05 Blood-Group PIC SX(3).
002100* Symptom Information
002200 02 Symptoms.
002300 03 Basic-Info.
002400 05 Name PIC X(4).
002500 05 Address PIC XXXX.
002600 05 Phone-Number PIC 9(10).
002700 05 Admin PIC XXXX.
002800* Treatment Details
002900 02 Treatments.
003000 03 Basic-Info.
003100 05 Name PIC X(4).
003200 05 Type PIC XXXX.
003300 05 Code PIC 9(10).
003400 05 Amount PIC 999V9.
003500* Doctor Availabilty Info
003600 02 Doctors.
003700 03 Basic-Info.
003800 05 Name PIC X(4).
003900 05 Address PIC XXXX.
004000 05 Phone-Number PIC 9(10).
004100 05 Admin PIC XXXX.
004200* Facilities Availabilty
004300 02 Facilities.
004400 03 Basic-Info.
004500 05 Name PIC X(4).
004600 05 Address PIC XXXX.
004700 05 Phone-Number PIC 9(10).
004800 05 Admin PIC X(4).
Sample JSON :
[
{
"HospitalsCopyBook": {
"Hospitals": {
"Basic-Info" :
{
"Name" : "AA",
"Address" : "HYD",
"Phone-Number" : 1111111111,
"Admin" : "ABCD"
}
},
"Wards": {
"Basic-Info":
{
"Name" : "BB",
"Address" : "BNG",
"Number" : 2222222222,
"Admin" : "XYZA"
}
},
"Patients": {
"Basic-Info":
{
"Name" : "CC",
"Address" : "TPT",
"Phone-Number" : 3333333333,
"Blood-Group" : "+ve"
}
},
"Symptoms": {
"Basic-Info":
{
"Name" : "DD",
"Address" : "KDP",
"Phone-Number" : 4444444444,
"Admin" : "PQRS"
}
},
"Treatments": {
"Basic-Info":
{
"Name" : "EE",
"Type" : "NML",
"Code" : 55555,
"Amount" : 123.4
}
},
"Doctors": {
"Basic-Info":
{
"Name" : "FF",
"Address" : "RJPT",
"Phone-Number" : 6666666666,
"Admin" : "MNOP"
}
},
"Facilities": {
"Basic-Info":
{
"Name" : "GG",
"Address" : "PNGL",
"Phone-Number" : 7777777777,
"Admin" : "KLMN"
}
}
}
}
]
Note: Map field by field in dataweave
Mule Flow :
Sample Flatfile Data :
AAAABNGL1234567890AAAABBBBHYDB1234567890BBBBCCCCRJPT1234567890+veD
DDDTPTT1234567890DDDDEEEENMLR123456789012304FFFFPNG1234567890FFFFG
GGGKLMN1234567890GGGG
Thank Q

More Related Content

Recently uploaded

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 

Recently uploaded (20)

Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Mule flatfile-json

  • 1. Mule ESB – DataWeave - CopyBook Flat file To JSON Conversion using Copybook Schema
  • 2. Steps : 1) First configure the ‘HTTP’ connector as a source in Anypoint Studio Mule. 2) Drag & Drop the ‘Transform Message’ from the Mule palette window for conversion. 3) In the Transform Message as input metadata provide copybook schema at the same time as output metadata provide JSON Data. Because of Flatfile – JSON conversion using copybook schema. 4) Drag & Drop ‘Byte Array to String’ Transformer from Mule Palette window for converting result into string.
  • 3. 5) Finally use the Logger for logging the result message. Note: Find the Sample Copybook & JSON Data in the next slides.
  • 4. Sample Copybook : 000000 01 HospitalsCopyBook. 000100 02 Hospitals. 000200 03 Basic-Info. 000300 05 Name PIC X(4). 000400 05 Address PIC XXXX. 000500 05 Phone-Number PIC 9(10). 000600 05 Admin PIC XXXX. 000700* Ward Information 000800 02 Wards. 000900 03 Basic-Info. 001000 05 Name PIC XXXX. 001100 05 Address PIC X(4). 001200 05 Number PIC 9999999999. 001300 05 Admin PIC X(4). 001400* Patient Information 001500 02 Patients. 001600 03 Basic-Info. 001700 05 Name PIC XXXX. 001800 05 Address PIC X(4). 001900 05 Phone-Number PIC 9(10). 002000 05 Blood-Group PIC SX(3).
  • 5. 002100* Symptom Information 002200 02 Symptoms. 002300 03 Basic-Info. 002400 05 Name PIC X(4). 002500 05 Address PIC XXXX. 002600 05 Phone-Number PIC 9(10). 002700 05 Admin PIC XXXX. 002800* Treatment Details 002900 02 Treatments. 003000 03 Basic-Info. 003100 05 Name PIC X(4). 003200 05 Type PIC XXXX. 003300 05 Code PIC 9(10). 003400 05 Amount PIC 999V9. 003500* Doctor Availabilty Info 003600 02 Doctors. 003700 03 Basic-Info. 003800 05 Name PIC X(4). 003900 05 Address PIC XXXX. 004000 05 Phone-Number PIC 9(10). 004100 05 Admin PIC XXXX.
  • 6. 004200* Facilities Availabilty 004300 02 Facilities. 004400 03 Basic-Info. 004500 05 Name PIC X(4). 004600 05 Address PIC XXXX. 004700 05 Phone-Number PIC 9(10). 004800 05 Admin PIC X(4).
  • 7. Sample JSON : [ { "HospitalsCopyBook": { "Hospitals": { "Basic-Info" : { "Name" : "AA", "Address" : "HYD", "Phone-Number" : 1111111111, "Admin" : "ABCD" } }, "Wards": { "Basic-Info": { "Name" : "BB", "Address" : "BNG", "Number" : 2222222222, "Admin" : "XYZA" } },
  • 8. "Patients": { "Basic-Info": { "Name" : "CC", "Address" : "TPT", "Phone-Number" : 3333333333, "Blood-Group" : "+ve" } }, "Symptoms": { "Basic-Info": { "Name" : "DD", "Address" : "KDP", "Phone-Number" : 4444444444, "Admin" : "PQRS" } }, "Treatments": { "Basic-Info": { "Name" : "EE", "Type" : "NML", "Code" : 55555, "Amount" : 123.4 } },
  • 9. "Doctors": { "Basic-Info": { "Name" : "FF", "Address" : "RJPT", "Phone-Number" : 6666666666, "Admin" : "MNOP" } }, "Facilities": { "Basic-Info": { "Name" : "GG", "Address" : "PNGL", "Phone-Number" : 7777777777, "Admin" : "KLMN" } } } } ] Note: Map field by field in dataweave
  • 11. Sample Flatfile Data : AAAABNGL1234567890AAAABBBBHYDB1234567890BBBBCCCCRJPT1234567890+veD DDDTPTT1234567890DDDDEEEENMLR123456789012304FFFFPNG1234567890FFFFG GGGKLMN1234567890GGGG