on 09-30-2011 8:23 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks for responding to this thread. I was able to implement the required scenario using your suggestions
Thanks
-Pradeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.