Question

How would I would go about merging 2 input XML schemas into 1 CSV output file?

The 2 inputs each have 1 root, 1 child record, and 5 child field elements within the child record. the output has 10 field elements, 1 for each of the 5 fields in both the inputs (keeping it simple to start)

As it stands in my orchestration I have a parallel actions object, with 2 receive shapes, they lead into a construct message with a transform, I've specified the 2 input messages, and the output message for that transform, and it then leads into a send shape. I've configured 3 ports, to receives and a send, the receives both have portbinding set to specify now, with transport being file, and I've specified a folder. the send also has port Binding set to specify now, with transport being XMLTransmit and I've specified an output CSV file.

In the generated map, I simply have each of the 5 fields from the input linked to their respective field in the output.

I'm missing something to have the 2 files merge properly into a CSV. Do I need a special map, or do I have to change some settings somewhere so that the output file is generated as a CSV as apposed to XML.

EDIT - I did also configure the 3 messages, and I sorta did a correlation, but I'm not really sure what to do with the correlation.

What things should I select when creating the correlation type?

Was it helpful?

Solution

You will also need

1) To have a schema with the 10 fields that is defined as a Flat File Schema (Add new Item, Flat File Schema), in which you define child delimiter on the root with Child Delimiter Type Hexadecimal and the Child Delimiter as 0x0D 0x0A (Carriage Return, Line Feed). Then on the record you must set the Child Delimiter Type Character and the Child Delimiter as , (comma). You may also want to set the Wrap Character to " on the fields if you expect any commas in your data.

2) You need to add a Send Pipeline with (Add New Item, Send Pipeline), in which you need to put the Flat file assembler in the Assemble stage and where the Document Schema points at the schema from 1 above.

3) You need to update you map that maps to two inputs to use the schema above.

4) You need to select the pipeline from 2 in your send port.

For the correlation you will usually set it to a promoted property of something in the message, as you haven't defined are what the criteria for matching the two files are I can't be more specific. Examples include a date in the file (e.g. you want to match two files with the same date). Try it without correlation first and get that working, you can add correlation later.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top