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

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
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
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
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
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
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
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
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 

Recently uploaded (20)

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
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
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
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.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
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
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...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 

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/