cancel
Showing results for 
Search instead for 
Did you mean: 

Replicating header values in text file payload for each recordset

Former Member
0 Kudos

Hello everyone,

I have a configured a Sender File Adapter that uses Content Conversion to translate a text file into XML.

Currently, one message is created for each groupings of B, C, and D (see below). A is the header portion.

example.txt

A 20081010

B 0100012

C 234

D 0000001

B 0100013

C 235

D 0000002

Using the above text file as an example, I get two messages generated:

Output 1
<Recordset>
<Header>
	<A>20081010</A>
</Header>
<Details>
	<B>0100012</B>
	<C>234</C>
	<D>0000001</D>
</Details>
</Recordset>

Output 2
<Recordset>
<Details>
	<B>0100013</B>
	<C>235</C>
	<D>0000002</D>
</Details>
</Recordset>

However, I want the output to replicate the value in A to the header portion of each of the succeeding messages:

Desired Output 1
<Recordset>
<Header>
	<A>20081010</A>
</Header>
<Details>
	<B>0100012</B>
	<C>234</C>
	<D>0000001</D>
</Details>
</Recordset>

Desired Output 2
<Recordset>
<Header>
	<A>20081010</A>
</Header>
<Details>
	<B>0100013</B>
	<C>235</C>
	<D>0000002</D>
</Details>
</Recordset>

Can anyone help me out?

Kind regards,

Glenn

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hey Guys!

thanks for your replies! As I understand it, the UseOneAsMany function may be used for one mapping; however, in my case, a new XML file (hence new mapping instance) is generated for each occurence of the Group B, C, and D.

I don't think I can use the UseOneAsMany in this case. Please correct me if I'm wrong.

Warm regards,

Glenn

Former Member
0 Kudos

HI Glenn

If the requirement is to generate the field A header for all the occurances that is doable using UseOneAsMany and even you can map header multiple times in target. But if you want to do it before mapping to satisfy your source XML generated with field A multiple times. Then either you have to go for adapter module or Script to modify file itself before reading.

Thanks

Gaurav

VijayKonam
Active Contributor
0 Kudos

UseOneAsMany node function in the message mapping..!!

VJ