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+v
eDDDDTPTT1234567890DDDDEEEENMLR123456789012304FFFFPNG1234567890FF
FFGGGGKLMN1234567890GGGG
Thank Q

More Related Content

More from VirtusaPolaris

More from VirtusaPolaris (6)

Mule error handling
Mule error handlingMule error handling
Mule error handling
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core concepts
 
Mule basics
Mule basicsMule basics
Mule basics
 
Mule copy book-tutorial
Mule copy book-tutorialMule copy book-tutorial
Mule copy book-tutorial
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule ESB - Demo
Mule ESB - DemoMule ESB - Demo
Mule ESB - Demo
 

Recently uploaded

UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
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)Zilliz
 
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 EngineeringWSO2
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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 Pakistandanishmna97
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfdanishmna97
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
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 SciencePaolo Missier
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
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....rightmanforbloodline
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Recently uploaded (20)

UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
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)
 
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...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
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
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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....
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

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+v eDDDDTPTT1234567890DDDDEEEENMLR123456789012304FFFFPNG1234567890FF FFGGGGKLMN1234567890GGGG