cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Message Mapping based on value of field - (Without BPM)

Former Member
0 Kudos

Hi.

I am having a bit of difficulty with multi-message mapping without BPM. I want to map to message1 & message2 based on a field in the rows of the source structure.

e.g.

row1-Source-Field1=> (if equal 0) => <b>Message1</b>-field1.

row2-Source-Field1=> (if equal 10) => <b>Message2</b>-field1.

To attempt to do this, I use the conditions in the graphical mapper:

if row-Source-Field1 = 0 => Map "Row to MessageType1".

if row-Source-Field1 = 10 => Map "Row to MessageType2".

However when I test this the mapping only seems to consider the first row value in row-Source-Field1 and ignores the fact that row two has a value of 10. I think this has something to do with contexts etc..

I would appreciate any help please.

Regards.

Mick.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ;

try this

row-Source-Field1<b>(remove Context)</b> = 0 => Map

if row-Source-Field1<b>(remove Context)</b> = 10 => Map

Mudit

Answers (1)

Answers (1)

Former Member
0 Kudos

This does help in that if I have only all the same values - then the Message Type is not mapped, however, if I have multiple values in my key fields it does not map the rwos of the second key.

e.g. if I have

row1-source-field1 = 0

row1-source-field1 = 0

row2-source-field1 = 10

The fisrt two rows are mapped to the relevant message type but the message type of the last row is not mapped.

Former Member
0 Kudos

in that case try this out

row1-source-field1 (remove context) -- UDF -splitbyvalue-target

UDF1(for message 1)

for(int i=0;i<field1.length;i++)

{

if(field1<i>.equals("0"))

{

result.addValue(<field to be mapped><i>);

}

}

UDF2(for message 2)

for(int i=0;i<field1.length;i++)

{

if(field1<i>.equals("10"))

{

result.addValue(<field to be mapped><i>);

}

}

Former Member
0 Kudos

Hi;

If this solves your prob award some points which will motivate me to help you further.

Mudit