cancel
Showing results for 
Search instead for 
Did you mean: 

1:N mapping related..

Former Member
0 Kudos

Hi All,

I am trying to implememt n:m mapping scenario where target needs to have m records instead of just one.

Example scenario

Source:

<MT_Source>

<Line>1<Line>

<Line>2<Line>

<Line>3<Line>

<Line>4<Line>

</MT_Source>

Want to accieve following target messages to contain 2 lines:

Message 1:

<MT_Target>

<Line>1<Line>

<Line>2<Line>

</MT_Target>

Message 2:

<MT_Target>

<Line>3<Line>

<Line>4<Line>

</MT_Target>

I looked at 1 to N mapping option, I am able to generate each message to have just one line but not 2 lines. Any help is appreaciated..

Thanks

-Pradeep

Edited by: Pradeep Mysore on Sep 30, 2011 9:23 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

It can be done through an UDF, in the UDF you need input parameter as 'Queue' where it will contain the number of occurrence of the source structure ( count ).

Use that count and divide by 2 to get the number of occurrence of the target root node.

Regards,

Indranil

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

Thanks for responding to this thread. I was able to implement the required scenario using your suggestions

Thanks

-Pradeep

0 Kudos

Hi Pradeep, Please use below link to resolve your issue

[|]

rgds

Mahesh

PriyankaAnagani
Active Contributor
0 Kudos

Hi Pradeep,

In the signature tab change the occurrence of target message to 0...unbounded and follow the below logic which will result in messages that consists of 2 lines each.

divide->ceil->splitbyvaluechange>collapsecontext>Mt_Target

formatByExample-->TargetLine

FormatByExample:

input1>SourceLineremovecontext

input2>divide>ceil-->splitByValueChange

divide:

input1-SourceLine->index(1,1)

input2--constant(2)

Regards

Priyanka