SlideShare a Scribd company logo
1 of 28
Alexandra Martinez
Reviewing a Complex DataWeave
Transformation Use-case
2
● Modules (Values module)
● Functions (fun)
○ Parameters using types
○ Parameters with default values
○ Tail Recursive
● Variables (var)
● do statement to create scopes (local variables)
● Object manipulation using object destructor {( )}
● If/else
● Selectors:
○ Index (array[0])
○ Range (1 to 10)
● Setting default values
● Core functions/operators
○ isEmpty, reduce, map, with
○ Sum (+), Append (+), Concatenation (++), Equality with coercion (~=)
Solution will make use of the following:
Requirement
4
Input JSON structure to Output JSON structure
Requirement
5
● Logic:
1. For each object from the
FlightOptions array, create one
output object inside the output array.
Requirement
5
6
● Logic:
1. For each object from the
FlightOptions array, create one
output object inside the output array.
2. The AppliedTaxCode will contain the
value from the last Connection
object.
Requirement
6
7
● Logic:
1. For each object from the
FlightOptions array, create one
output object inside the output array.
2. The AppliedTaxCode will contain the
value from the last Connection
object.
3. If the EndOfConnection field is true,
create a separate output object.
Requirement
7
8
● Logic:
1. For each object from the
FlightOptions array, create one
output object inside the output array.
2. The AppliedTaxCode will contain the
value from the last Connection
object.
3. If the EndOfConnection field is true,
create a separate output object.
4. If there are EndOfConnection fields
that are true and this is not the last
object inside the Connections array,
create a new output object
containing all the false Connection
objects before this, and using this
last object’s TaxCode.
Requirement
8
9
● Logic:
1. For each object from the
FlightOptions array, create one
output object inside the output array.
2. The AppliedTaxCode will contain the
value from the last Connection
object.
3. If the EndOfConnection field is true,
create a separate output object.
4. If there are EndOfConnection fields
that are true and this is not the last
object inside the Connections array,
create a new output object
containing all the false Connection
objects before this, and using this
last object’s TaxCode.
5. Each AppliedConnections object in
the output must have:
1. A hardcoded Type value
“Connection”.
Requirement
9
Building the Solution
11
● DW Playground: https://dwlang.fun
● Input payload:
{"FlightOptions":[{"Connections":[{"ReferenceID":111,"TaxCode":"ABC","EndOfConnection":false},{"ReferenceID":222,"TaxCode":"DEF","EndOfConnection":true}]},{"
Connections":[{"ReferenceID":333,"TaxCode":"GHI","EndOfConnection":true},{"ReferenceID":444,"TaxCode":"JKL","EndOfConnection":true}]},{"Connections":[{"Ref
erenceID":555,"TaxCode":"MNO","EndOfConnection":false},{"ReferenceID":666,"TaxCode":"PQR","EndOfConnection":false},{"ReferenceID":777,"TaxCode":"STU","
EndOfConnection":false}]},{"Connections":[{"ReferenceID":888,"TaxCode":"VWX","EndOfConnection":false}]},{"Connections":[{"ReferenceID":999,"TaxCode":"MNO"
,"EndOfConnection":false},{"ReferenceID":101,"TaxCode":"PQR","EndOfConnection":true},{"ReferenceID":102,"TaxCode":"STU","EndOfConnection":false}]}]}
● Expected output:
[{"AppliedTaxCode":"DEF","AppliedConnections":[{"Type":"Connection","IndexValue":1},{"Type":"Connection","IndexValue":2}]},{"AppliedTaxCode":"GHI","AppliedCo
nnections":[{"Type":"Connection","IndexValue":3}]},{"AppliedTaxCode":"JKL","AppliedConnections":[{"Type":"Connection","IndexValue":4}]},{"AppliedTaxCode":"STU
","AppliedConnections":[{"Type":"Connection","IndexValue":5},{"Type":"Connection","IndexValue":6},{"Type":"Connection","IndexValue":7}]},{"AppliedTaxCode":"VW
X","AppliedConnections":[{"Type":"Connection","IndexValue":8}]},{"AppliedTaxCode":"PQR","AppliedConnections":[{"Type":"Connection","IndexValue":9},{"Type":"C
onnection","IndexValue":10}]},{"AppliedTaxCode":"STU","AppliedConnections":[{"Type":"Connection","IndexValue":11}]}]
● Format JSONs:
https://jsonformatter.curiousconcept.com/
Building the Solution
12
1) Extract the Connections arrays.
Building the Solution
13
2) Change all the EndOfConnection to true for the last Connection object from the Connections
array.
Building the Solution
14
3) flatten the array of arrays to be just one array.
Building the Solution
15
4) Parameters:
1. connectionsArray - Current connections array (this will have less values each time, until array is
empty).
2. indexAccumulatorArray - Array with the indexes that are being accumulated for the ”IndexValue”
field.
3. index - Actual index number for each connection being evaluated.
4. connectionsAccumulatorArray - Array that will keep the transformed objects (final output) – This is
what makes our function a tail function.
Building the Solution – Tail Recursive function
16
Iteration 1:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = false
Nothing is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should
contain this index
because
thisConnectionEndOfConnection
is false.
17
Iteration 2:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = true
Object is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should go
back to [ ] because
thisConnectionEndOfConnection
is true.
18
Iteration 3:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = true
Object is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should go
back to [ ] because
thisConnectionEndOfConnection
is true.
19
Iteration 4:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = true
Object is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should go
back to [ ] because
thisConnectionEndOfConnection
is true.
20
Iteration 5:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = false
Nothing is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should
contain this index
because
thisConnectionEndOfConnection
is false.
21
Iteration 6:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = false
Nothing is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should
contain this index
because
thisConnectionEndOfConnection
is false.
22
Iteration 7:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = true
Object is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should go
back to [ ] because
thisConnectionEndOfConnection
is true.
23
Iteration 8:
Building the Solution – Tail Recursive function
connectionsArray (original array) indexAccumulatorArray
index
connectionsAccumulatorArray
thisConnection
EndOfConnection = true
Object is added to
connectionsAccumulatorArray
Next connection
indexAccumulatorArray should go
back to [ ] because
thisConnectionEndOfConnection
is true.
To be continued… 
Try it yourself!
Code
● GitHub repository: https://github.com/alexandramartinez/reviewing-a-complex-dw-
transformation-use-case/
References
● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-functions
● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-variables
● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-flow-control
● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-selectors
● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-cookbook-defaults
● https://docs.mulesoft.com/mule-runtime/4.3/dw-operators
● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-isempty
● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-reduce
● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-map
● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-plusplus
● https://blogs.mulesoft.com/dev-guides/how-to-tutorials/untie-multilevel-
structures-dataweave-recursive-calls/
Questions?
Contact me!
Website:
www.alexandramartinez.world
LinkedIn:
www.linkedin.com/in/alexandra-n-martinez
Twitter:
@alexmartinez_z
ProstDev.com

More Related Content

What's hot

Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightWiem Zine Elabidine
 
Java simple programs
Java simple programsJava simple programs
Java simple programsVEERA RAGAVAN
 
Module 13 operators, delegates, and events
Module 13 operators, delegates, and eventsModule 13 operators, delegates, and events
Module 13 operators, delegates, and eventsPrem Kumar Badri
 
Procedure to create_the_calculator_application java
Procedure to create_the_calculator_application javaProcedure to create_the_calculator_application java
Procedure to create_the_calculator_application javagthe
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cppgourav kottawar
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaWiem Zine Elabidine
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple ProgramsUpender Upr
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2Ankit Gupta
 
Kotlin Perfomance on Android / Александр Смирнов (Splyt)
Kotlin Perfomance on Android / Александр Смирнов (Splyt)Kotlin Perfomance on Android / Александр Смирнов (Splyt)
Kotlin Perfomance on Android / Александр Смирнов (Splyt)Ontico
 
Scientific calcultor-Java
Scientific calcultor-JavaScientific calcultor-Java
Scientific calcultor-JavaShaibal Ahmed
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsMohammad Shaker
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5Mahmoud Ouf
 

What's hot (20)

ZIO Queue
ZIO QueueZIO Queue
ZIO Queue
 
Intake 38 5
Intake 38 5Intake 38 5
Intake 38 5
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 
Zio from Home
Zio from Home Zio from Home
Zio from Home
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
 
Berlin meetup
Berlin meetupBerlin meetup
Berlin meetup
 
Constructor and destructor
Constructor  and  destructor Constructor  and  destructor
Constructor and destructor
 
Fiber supervision in ZIO
Fiber supervision in ZIOFiber supervision in ZIO
Fiber supervision in ZIO
 
Java simple programs
Java simple programsJava simple programs
Java simple programs
 
Module 13 operators, delegates, and events
Module 13 operators, delegates, and eventsModule 13 operators, delegates, and events
Module 13 operators, delegates, and events
 
Procedure to create_the_calculator_application java
Procedure to create_the_calculator_application javaProcedure to create_the_calculator_application java
Procedure to create_the_calculator_application java
 
constructor & destructor in cpp
constructor & destructor in cppconstructor & destructor in cpp
constructor & destructor in cpp
 
ZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in ScalaZIO: Powerful and Principled Functional Programming in Scala
ZIO: Powerful and Principled Functional Programming in Scala
 
Java Simple Programs
Java Simple ProgramsJava Simple Programs
Java Simple Programs
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
 
Kotlin Perfomance on Android / Александр Смирнов (Splyt)
Kotlin Perfomance on Android / Александр Смирнов (Splyt)Kotlin Perfomance on Android / Александр Смирнов (Splyt)
Kotlin Perfomance on Android / Александр Смирнов (Splyt)
 
Scientific calcultor-Java
Scientific calcultor-JavaScientific calcultor-Java
Scientific calcultor-Java
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
 
Java codes
Java codesJava codes
Java codes
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 

Similar to Reviewing a complex dataweave transformation use case v3

Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...ikram_ahamed
 
K is for Kotlin
K is for KotlinK is for Kotlin
K is for KotlinTechMagic
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfinfo309708
 
PYTHON-PROGRAMMING-UNIT-II (1).pptx
PYTHON-PROGRAMMING-UNIT-II (1).pptxPYTHON-PROGRAMMING-UNIT-II (1).pptx
PYTHON-PROGRAMMING-UNIT-II (1).pptxgeorgejustymirobi1
 
Александр Зимин (Alexander Zimin) — Магия Swift
Александр Зимин (Alexander Zimin) — Магия SwiftАлександр Зимин (Alexander Zimin) — Магия Swift
Александр Зимин (Alexander Zimin) — Магия SwiftCocoaHeads
 
Cocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magicCocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magicBadoo Development
 
Ecet 370 Education Organization -- snaptutorial.com
Ecet 370   Education Organization -- snaptutorial.comEcet 370   Education Organization -- snaptutorial.com
Ecet 370 Education Organization -- snaptutorial.comDavisMurphyB81
 
Extractors & Implicit conversions
Extractors & Implicit conversionsExtractors & Implicit conversions
Extractors & Implicit conversionsKnoldus Inc.
 
Ensure code quality with vs2012
Ensure code quality with vs2012Ensure code quality with vs2012
Ensure code quality with vs2012Sandeep Joshi
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxmaxinesmith73660
 
stacks and queues class 12 in c++
stacks and  queues class 12 in c++stacks and  queues class 12 in c++
stacks and queues class 12 in c++Khushal Mehta
 
ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com donaldzs157
 
Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...
Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...
Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...Thien Q. Tran
 

Similar to Reviewing a complex dataweave transformation use case v3 (20)

Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...
Indianapolis mule soft_meetup_14_apr_2021-Review a complex Dataweave Transfor...
 
Computer programming 2 Lesson 10
Computer programming 2  Lesson 10Computer programming 2  Lesson 10
Computer programming 2 Lesson 10
 
Javascript
JavascriptJavascript
Javascript
 
OS.pptx
OS.pptxOS.pptx
OS.pptx
 
K is for Kotlin
K is for KotlinK is for Kotlin
K is for Kotlin
 
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdfGetting StartedCreate a class called Lab8. Use the same setup for .pdf
Getting StartedCreate a class called Lab8. Use the same setup for .pdf
 
PYTHON-PROGRAMMING-UNIT-II (1).pptx
PYTHON-PROGRAMMING-UNIT-II (1).pptxPYTHON-PROGRAMMING-UNIT-II (1).pptx
PYTHON-PROGRAMMING-UNIT-II (1).pptx
 
Александр Зимин (Alexander Zimin) — Магия Swift
Александр Зимин (Alexander Zimin) — Магия SwiftАлександр Зимин (Alexander Zimin) — Магия Swift
Александр Зимин (Alexander Zimin) — Магия Swift
 
Cocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magicCocoaheads Meetup / Alex Zimin / Swift magic
Cocoaheads Meetup / Alex Zimin / Swift magic
 
Ecet 370 Education Organization -- snaptutorial.com
Ecet 370   Education Organization -- snaptutorial.comEcet 370   Education Organization -- snaptutorial.com
Ecet 370 Education Organization -- snaptutorial.com
 
Extractors & Implicit conversions
Extractors & Implicit conversionsExtractors & Implicit conversions
Extractors & Implicit conversions
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Ensure code quality with vs2012
Ensure code quality with vs2012Ensure code quality with vs2012
Ensure code quality with vs2012
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 
Chapter2
Chapter2Chapter2
Chapter2
 
stacks and queues class 12 in c++
stacks and  queues class 12 in c++stacks and  queues class 12 in c++
stacks and queues class 12 in c++
 
ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com ECET 370 Exceptional Education - snaptutorial.com
ECET 370 Exceptional Education - snaptutorial.com
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...
Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...
Set Transfomer: A Framework for Attention-based Permutaion-Invariant Neural N...
 

More from Alexandra N. Martinez

Mejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de SlackMejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de SlackAlexandra N. Martinez
 
Women Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: GhostWomen Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: GhostAlexandra N. Martinez
 
Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...Alexandra N. Martinez
 
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderToronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderAlexandra N. Martinez
 
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-caseToronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-caseAlexandra N. Martinez
 
Cómo generar e implementar monitoreo para aplicaciones de Mule
Cómo generar e implementar monitoreo para aplicaciones de MuleCómo generar e implementar monitoreo para aplicaciones de Mule
Cómo generar e implementar monitoreo para aplicaciones de MuleAlexandra N. Martinez
 
reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4Alexandra N. Martinez
 
Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)Alexandra N. Martinez
 
Toronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics acceleratorToronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics acceleratorAlexandra N. Martinez
 
What is munit and how to create your first unit test
What is munit and how to create your first unit testWhat is munit and how to create your first unit test
What is munit and how to create your first unit testAlexandra N. Martinez
 
Toronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for ReusabilityToronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for ReusabilityAlexandra N. Martinez
 
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)Alexandra N. Martinez
 
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...Alexandra N. Martinez
 
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureToronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureAlexandra N. Martinez
 
How to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in MuleHow to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in MuleAlexandra N. Martinez
 
Meetup en español #4 - MuleSoft para profesionales de Java
 Meetup en español #4 - MuleSoft para profesionales de Java Meetup en español #4 - MuleSoft para profesionales de Java
Meetup en español #4 - MuleSoft para profesionales de JavaAlexandra N. Martinez
 
Toronto Virtual Meetup #5 - API Security and Threats
Toronto Virtual Meetup #5 - API Security and ThreatsToronto Virtual Meetup #5 - API Security and Threats
Toronto Virtual Meetup #5 - API Security and ThreatsAlexandra N. Martinez
 

More from Alexandra N. Martinez (20)

Mejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de SlackMejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de Slack
 
Women Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: GhostWomen Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: Ghost
 
Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...
 
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderToronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
 
Women Who Mule - June Meetup (EMEA)
Women Who Mule - June Meetup (EMEA)Women Who Mule - June Meetup (EMEA)
Women Who Mule - June Meetup (EMEA)
 
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-caseToronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
 
Cómo generar e implementar monitoreo para aplicaciones de Mule
Cómo generar e implementar monitoreo para aplicaciones de MuleCómo generar e implementar monitoreo para aplicaciones de Mule
Cómo generar e implementar monitoreo para aplicaciones de Mule
 
reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4
 
Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)
 
Toronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics acceleratorToronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics accelerator
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 
What is munit and how to create your first unit test
What is munit and how to create your first unit testWhat is munit and how to create your first unit test
What is munit and how to create your first unit test
 
Truly Human part 1
Truly Human part 1Truly Human part 1
Truly Human part 1
 
Toronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for ReusabilityToronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for Reusability
 
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
 
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
 
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureToronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
 
How to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in MuleHow to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in Mule
 
Meetup en español #4 - MuleSoft para profesionales de Java
 Meetup en español #4 - MuleSoft para profesionales de Java Meetup en español #4 - MuleSoft para profesionales de Java
Meetup en español #4 - MuleSoft para profesionales de Java
 
Toronto Virtual Meetup #5 - API Security and Threats
Toronto Virtual Meetup #5 - API Security and ThreatsToronto Virtual Meetup #5 - API Security and Threats
Toronto Virtual Meetup #5 - API Security and Threats
 

Recently uploaded

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxsqpmdrvczh
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 

Recently uploaded (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Romantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptxRomantic Opera MUSIC FOR GRADE NINE pptx
Romantic Opera MUSIC FOR GRADE NINE pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

Reviewing a complex dataweave transformation use case v3

  • 1. Alexandra Martinez Reviewing a Complex DataWeave Transformation Use-case
  • 2. 2 ● Modules (Values module) ● Functions (fun) ○ Parameters using types ○ Parameters with default values ○ Tail Recursive ● Variables (var) ● do statement to create scopes (local variables) ● Object manipulation using object destructor {( )} ● If/else ● Selectors: ○ Index (array[0]) ○ Range (1 to 10) ● Setting default values ● Core functions/operators ○ isEmpty, reduce, map, with ○ Sum (+), Append (+), Concatenation (++), Equality with coercion (~=) Solution will make use of the following:
  • 4. 4 Input JSON structure to Output JSON structure Requirement
  • 5. 5 ● Logic: 1. For each object from the FlightOptions array, create one output object inside the output array. Requirement 5
  • 6. 6 ● Logic: 1. For each object from the FlightOptions array, create one output object inside the output array. 2. The AppliedTaxCode will contain the value from the last Connection object. Requirement 6
  • 7. 7 ● Logic: 1. For each object from the FlightOptions array, create one output object inside the output array. 2. The AppliedTaxCode will contain the value from the last Connection object. 3. If the EndOfConnection field is true, create a separate output object. Requirement 7
  • 8. 8 ● Logic: 1. For each object from the FlightOptions array, create one output object inside the output array. 2. The AppliedTaxCode will contain the value from the last Connection object. 3. If the EndOfConnection field is true, create a separate output object. 4. If there are EndOfConnection fields that are true and this is not the last object inside the Connections array, create a new output object containing all the false Connection objects before this, and using this last object’s TaxCode. Requirement 8
  • 9. 9 ● Logic: 1. For each object from the FlightOptions array, create one output object inside the output array. 2. The AppliedTaxCode will contain the value from the last Connection object. 3. If the EndOfConnection field is true, create a separate output object. 4. If there are EndOfConnection fields that are true and this is not the last object inside the Connections array, create a new output object containing all the false Connection objects before this, and using this last object’s TaxCode. 5. Each AppliedConnections object in the output must have: 1. A hardcoded Type value “Connection”. Requirement 9
  • 11. 11 ● DW Playground: https://dwlang.fun ● Input payload: {"FlightOptions":[{"Connections":[{"ReferenceID":111,"TaxCode":"ABC","EndOfConnection":false},{"ReferenceID":222,"TaxCode":"DEF","EndOfConnection":true}]},{" Connections":[{"ReferenceID":333,"TaxCode":"GHI","EndOfConnection":true},{"ReferenceID":444,"TaxCode":"JKL","EndOfConnection":true}]},{"Connections":[{"Ref erenceID":555,"TaxCode":"MNO","EndOfConnection":false},{"ReferenceID":666,"TaxCode":"PQR","EndOfConnection":false},{"ReferenceID":777,"TaxCode":"STU"," EndOfConnection":false}]},{"Connections":[{"ReferenceID":888,"TaxCode":"VWX","EndOfConnection":false}]},{"Connections":[{"ReferenceID":999,"TaxCode":"MNO" ,"EndOfConnection":false},{"ReferenceID":101,"TaxCode":"PQR","EndOfConnection":true},{"ReferenceID":102,"TaxCode":"STU","EndOfConnection":false}]}]} ● Expected output: [{"AppliedTaxCode":"DEF","AppliedConnections":[{"Type":"Connection","IndexValue":1},{"Type":"Connection","IndexValue":2}]},{"AppliedTaxCode":"GHI","AppliedCo nnections":[{"Type":"Connection","IndexValue":3}]},{"AppliedTaxCode":"JKL","AppliedConnections":[{"Type":"Connection","IndexValue":4}]},{"AppliedTaxCode":"STU ","AppliedConnections":[{"Type":"Connection","IndexValue":5},{"Type":"Connection","IndexValue":6},{"Type":"Connection","IndexValue":7}]},{"AppliedTaxCode":"VW X","AppliedConnections":[{"Type":"Connection","IndexValue":8}]},{"AppliedTaxCode":"PQR","AppliedConnections":[{"Type":"Connection","IndexValue":9},{"Type":"C onnection","IndexValue":10}]},{"AppliedTaxCode":"STU","AppliedConnections":[{"Type":"Connection","IndexValue":11}]}] ● Format JSONs: https://jsonformatter.curiousconcept.com/ Building the Solution
  • 12. 12 1) Extract the Connections arrays. Building the Solution
  • 13. 13 2) Change all the EndOfConnection to true for the last Connection object from the Connections array. Building the Solution
  • 14. 14 3) flatten the array of arrays to be just one array. Building the Solution
  • 15. 15 4) Parameters: 1. connectionsArray - Current connections array (this will have less values each time, until array is empty). 2. indexAccumulatorArray - Array with the indexes that are being accumulated for the ”IndexValue” field. 3. index - Actual index number for each connection being evaluated. 4. connectionsAccumulatorArray - Array that will keep the transformed objects (final output) – This is what makes our function a tail function. Building the Solution – Tail Recursive function
  • 16. 16 Iteration 1: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = false Nothing is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should contain this index because thisConnectionEndOfConnection is false.
  • 17. 17 Iteration 2: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = true Object is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should go back to [ ] because thisConnectionEndOfConnection is true.
  • 18. 18 Iteration 3: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = true Object is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should go back to [ ] because thisConnectionEndOfConnection is true.
  • 19. 19 Iteration 4: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = true Object is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should go back to [ ] because thisConnectionEndOfConnection is true.
  • 20. 20 Iteration 5: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = false Nothing is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should contain this index because thisConnectionEndOfConnection is false.
  • 21. 21 Iteration 6: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = false Nothing is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should contain this index because thisConnectionEndOfConnection is false.
  • 22. 22 Iteration 7: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = true Object is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should go back to [ ] because thisConnectionEndOfConnection is true.
  • 23. 23 Iteration 8: Building the Solution – Tail Recursive function connectionsArray (original array) indexAccumulatorArray index connectionsAccumulatorArray thisConnection EndOfConnection = true Object is added to connectionsAccumulatorArray Next connection indexAccumulatorArray should go back to [ ] because thisConnectionEndOfConnection is true. To be continued… 
  • 25. Code ● GitHub repository: https://github.com/alexandramartinez/reviewing-a-complex-dw- transformation-use-case/
  • 26. References ● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-functions ● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-variables ● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-flow-control ● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-selectors ● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-cookbook-defaults ● https://docs.mulesoft.com/mule-runtime/4.3/dw-operators ● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-isempty ● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-reduce ● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-map ● https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-plusplus ● https://blogs.mulesoft.com/dev-guides/how-to-tutorials/untie-multilevel- structures-dataweave-recursive-calls/