Reputation: 95
I have XML schema with some data. I need to convert this schema to Flat-File AND add the constant header, which is given separately as a string.
I have 2 possible solutions:
Since header values are fixed and happen only once, I will create a separate record for header. In this case I will have 2 records level. 1. HeaderTitles and 2. Records. So I use the HeaderTitle record as a filter.
We can create 2 schemas:
(1) Header - This will have one string element type, "Name Age Country". (This is the column header)
(2) Body - This will be the actual data records. This will have 3 elements, the name, age & the country as repeating records.
In the pipeline assembler, there is a property where we can decide whether we want to include the header info or not in the final message. We can just disable this.
Can I do this in some other way?
Upvotes: 0
Views: 1780
Reputation: 11527
I would recommend Option 1 where you have the header in the Flat File schema and you either have default values specified in the schema or set them in the map would be the best and easiest in in my opinion the correct approach.
The only time I would use option 2 is if you had the flat file incoming and needed to disassemble it and actually needed to debatch the record lines into separate messages, which you would do be defining the Body record as occurs 1.
Upvotes: 1