cancel
Showing results for 
Search instead for 
Did you mean: 

Key field from content - Sender file adapter content conversion

Former Member
0 Kudos

I am reading a source CSV file that has this structure. All rows in the source file are the same structure: line items of a PO. But there will be multiple POs in a single file, identified by the PO number as one column in the file.

PONum,LineItemNum,Qty,Description 001,1,34,Carrots 001,2,17,Apples 001,3,22,Bananas 002,1,4,Mangos 002,2,9,Coconuts 003,1,44,Grapes

Goal is to generate 3 messages, one for each PO:

<po> <num>001</num> <line_items> ... 3 line items for PO # 001 ... </line_items> </po> <po> <num>002</num> <line_items> ... 2 line items for PO # 002 ... </line_items> </po> <po> <num>003</num> <line_items> ... 1 line item for PO # 003 ... </line_items> </po>

Is there any way to use the Content Conversion Key Field Name to group the line items into the correct 3 messages? "Key Field Name" expects a static identifier for each type of row; but mine varies by the PO number in the content.

Or do I need to do this in the mapping? If so, what is the easiest way to split 1 large message of all line items into multiple target messages based on the PO number? (I assume this is better than sending individual line item messages and aggregating them later, as long as the file size is OK.)

Thanks in advance!

RBL

Edited by: Robert Burfoot-Lobo on Apr 8, 2009 11:43 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Robert,

If ur goal is to split into 3 messages one for each PO, you can go for message split and using graphical mapping you can achieve that.

Within the message mapping go to the tab Messages.

Change the occurrence of the target message to 0..unbounded.

Also this link may help you.

/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool

Regards,

Madhu

Former Member
0 Kudos

Awesome find - thanks Madhu & others. Newbie mistake. I was on the wrong path by thinking Content Conversion in the file adapter was the right/easy place to do this, when this blog clearly shows my problem is best solved with a 1:n mapping.

Kiran: it varies. Perhaps there would be a way if was fixed? But that is not the case for me.

Joel: I think my head was between my knees on this one...

Answers (2)

Answers (2)

JoelTrinidade
Active Contributor
0 Kudos

hi Robert,

When you have a headache you press your head , not your knees.

I wonder from where you got this idea of doing in content conversion when you have graphical mapping.

Regards

joel

Former Member
0 Kudos

Hi,

Does the number of PO's remain constant or varies from file to file..

Thanks,

Kiran