I have a Mule application that needs to produce some CSV output which looks like the following:
[CSV Payload 1]
Data|Data|Data
[CSV Payload 2]
Data|Data|Data|Data|Data|Data|Data|Data|Data
[CSV Payload 3]
Data|Data|Data|Data
[CSV Payload 4]
Data|Data|Data|Data|Data|Data
As you can see, I have a combination of 4 CSV payloads, each with different structures. The first two of these payloads are single line and hard coded. The third is derived from an input file and the fourth is an extract from a database.
My question is: is DataWeave suitable for achieving this or should an alternative method (such as scatter gather) be explored? I've tried to implement this in DataWeave with no luck as I'm struggling to get past the limitation of having to define an output structure.
Please note: the order of the final output needs to be Payload 1 then 2 then 3 then 4. This order cannot be mixed up.