1
votes

I'm fairly new to Mule, and have spent a while reading

I'm putting the result of a database query (using a Database Endpoint) into a fixed-width file. I'm wondering if there is a way to map the query (which is a List of Map objects, I believe) straight to a Fixed Width file.

After much searching, (and since the examples that are for Anypoint Studio don't apply, since I'm using Mule Studio) I made my flow like this:

My Mule flowflow

Is there a better, one-step way that I can be mapping straight from the db query to the fixed-width file without the "Maps to CSV" Transformer in there?

Thanks!

1
You don't tell us your version of Mule ESB etc. However. DataMapper is able to transform from a list of Map<K,V> to Fixed Width directly.Petter Nordlander
I'm using Mule Studio, v 3.5.0. Great! What does that direct transformation look like? I haven't found an resources yet that have been helpful.arthur.e.anderson
Added an image as answer. That screen is from Mule Studio 3.5.0Petter Nordlander

1 Answers

1
votes

Simply choose a DataMapper node and select "Map" as source type and "Fixed Width" as target type. Define the fields in the Map (or list of maps). The field names are equal to the keys in the map (essentially column names in the Database case).

The same goes for fixed with.

Mule Studio Datamapper Map to fixed