Hi,
We have a requirement in our project to split the incoming msg into N number of messages based on a particluar field(PLANT) . This field(PLANT) repeats multiple times in the input payload and can have different values.
The message corresponding to each PLANT should be routed to different receiver.
For Ex : Plant A to Receiver1
Plant B to Receiver 2
Plant c to Receiver and so on.
There can be totaly 21 different values for Plant field.
Ex Input xml :
<?xml version="1.0" encoding="UTF-8"?>
novartis.com:pi:ph:0x:XXX">
<row>
<PLANT>A</PLANT>
<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>
<BATCH_G>Batch_G1</BATCH_G>
</row>
<row>
<PLANT>B</PLANT>
<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>
<BATCH_G>Batch_G2</BATCH_G>
</row>
<row>
<PLANT>C</PLANT>
<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>
<BATCH_G>Batch_G2</BATCH_G>
</row>
</ns0:MT_dbXXX>
Output should be :
Receiver1 should get :
<?xml version="1.0" encoding="UTF-8"?>
novartis.com:pi:ph:0x:XXX">
<row>
<PLANT>A</PLANT>
<EXTERNAL_NUMBER>12</EXTERNAL_NUMBER>
<BATCH_G>Batch_G1</BATCH_G>
</row>
</ns0:MT_dbXXX>
Receiver 2:
<?xml version="1.0" encoding="UTF-8"?>
novartis.com:pi:ph:0x:XXX">
<row>
<PLANT>B</PLANT>
<EXTERNAL_NUMBER>13</EXTERNAL_NUMBER>
<BATCH_G>Batch_G2</BATCH_G>
</row>
</ns0:MT_dbXXX>
Receiver 3:
<?xml version="1.0" encoding="UTF-8"?>
novartis.com:pi:ph:0x:XXX">
<row>
<PLANT>C</PLANT>
<EXTERNAL_NUMBER>14</EXTERNAL_NUMBER>
<BATCH_G>Batch_G2</BATCH_G>
</row>
</ns0:MT_dbXXX>
Can anyone please sugest how to do this.
Regards
Jagruthi