7. 7
● Logic:
1. For each object from the
FlightOptions array, create one
output object inside the output array.
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.
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.
Requirement
9
10. 10
● 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
10
11. 11
● 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
11
15. 15
2) Change all the EndOfConnection to true for the last Connection object from the Connections
array.
Building the Solution
16. 16
3) flatten the array of arrays to be just one array.
Building the Solution
17. 17
4) Add a new field to keep track of the object’s index, basing on the EndOfConnection field.
(For each EndOfConnection=true, stop incrementing the index.)
Building the Solution
Index 1
Index 2
Index 1
Index 1
Index 1
Index 3
Index 2
18. 18
5) Add a new field to keep track of the final AppliedConnections object’s (first) index where the
object in question will be added.
Note: This is calculated using the object’s index + 1 (to start at 1) and then minus the previously
added indexBasedOnEOC field.
Building the Solution
Index 0
Index 2
Index 3
Index 4
19. 19
6) Separate the objects based on the EndOfConnection value (true or false).
Building the Solution
20. 20
7) Take only the objects that are inside the “true” list.
Building the Solution
32. MuleSoft News for November
• There is still time to register and submit a project for the MuleSoft Hackthon 2020! If you
are interested in participating the deadline for register and submit is Nov 29, 2020 at 11:59
pm PT. https://www.mulesoft.com/hackathon2020
• Register and complete the free training course offered by MuleSoft
Anypoint Platform Development: Fundamentals
• The course prepares students to take the MuleSoft Certified Developer - Level 1 (Mule
4) exam. Upon successful completion of the course, students automatically receive two
exam attempts. https://training.mulesoft.com/course/development-fundamentals-mule4
• Try out the new features of Anypoint Studio 7.7! https://docs.mulesoft.com/release-
notes/studio/anypoint-studio-7.7-with-4.3-runtime-release-notes
33. Take a Stand
Nominate yourself for the next meetup speaker and
suggest a topic as well.
34. What’s Next
• Share:
– Invite your network to join: https://meetups.mulesoft.com/vancouver/
• Feedback:
– Contact your organizers to suggest topics
– Contact MuleSoft at meetup@mulesoft.com for ways to improve the program
– Your feedback is fuel for us
• Our next meetup:
– Date: early Jan 2021
– Location: Virtual
– Topic: TBD
35. See you next time
Please send topic suggestions to the organizer