cancel
Showing results for 
Search instead for 
Did you mean: 

Collectiing..grouping..consolidating and then send messages

Former Member
0 Kudos

Hi,

I have a scenario here where I have to collect messages (for eg. xml files) on a per day basis, consolidate the data into a single file for each vendor and send it.

For eg. My input files may be

Message1:

<Vendor>A</Vendor>

<Quantity>10</Quantity>

Message2:

<Vendor>B</Vendor>

<Quantity>20</Quantity>

Message3:

<Vendor>A</Vendor>

<Quantity>5</Quantity>

Message4:

<Vendor>B</Vendor>

<Quantity>3</Quantity>

Message5:

<Vendor>C</Vendor>

<Quantity>7</Quantity>

My output should be a seperate file for each vendor with total quantity for that vendor

Output1:

<Vendor>A</Vendor>

<Quantity>15</Quantity>

Output2:

<Vendor>B</Vendor>

<Quantity>23</Quantity>

Output3:

<Vendor>C</Vendor>

<Quantity>7</Quantity>

Each file has total quantity for that vendor. A,B,C are example vendors..we could have any vendor. So I cannot hard code their names. Ideally I want to group them by quantity.

I understand we have to use correlation to collect messages. My questions are how can I group the messages by vendor (collect messages from different vendors in different containers) and total the quantity and consolidate the message?

Your suggestions would be of great help.

Thanks

Karthik

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Kartik,

It depends where you want to consolidate the message, before you send it to XI or within XI itself. If you are planning to do the consolidation within XI itself, you could use Java Mapping.

You can read more about Java Mapping from:

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

/people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii

You could use a Java Hashmap where the Vendor would be a key and value can be set if key is not present, else value can be simply added.

Hope I am able to answer you problem.

Regards,

Keerti