on 10-19-2006 9:19 PM
Hi All,
My source structure is
<root>
<a></a>
<type>
<val1>
</val1>
</type>
</root>
Here the cardinality goes like this
<a> 1..1
<type> 1..unbounded
<val1> 1..1
Target structure
<test>
<action>insert</action>
<table>table1</table>
<access>
<tval></tval>
</access>
</test>
My requirement is if field a's value is "const" I need to have <access> node in my target struct as many times as <type>. I tried mapping <type> to <access>
I used a 'if with out else' to map <tval>. The mapping is like
condition part of 'if with out else' --> check <a> equals "const"
then part 'if with out else'--> <val1>
Result part of 'if with out else' --> <tval>
The problem here is, <access> node is created as many times as <type> but <tval> is created only for the first <access> node.
Can you help me out.... This is a bit urgent.. Pls do reply...
Thanks & Regards,
Jai Shankar.
Hi
Please use something like that in your target access
element:
a)
for your <access> element use ifWithoutElse
condition:
useOneAsMany(equals(<a>,'const'),<type>,<type>)
input:
<type>
b)
for your <tval> element direct mapping
<val1> -> <tval>
Regards,
Wojtek
Message was edited by: Wojciech Gasiorowski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wojtek,
Many thanks....
But still there is error
Sorry I gave the <val1> node as input instead of <type> hence the err!!
Now the mapping is done exactly as you said...
The problem is I am getting <access> node as many times as <type> node but again <tval> is produced for the first <access> node....
Pls throw some light on this...
Thanks a ton,
Jai Shankar.
Message was edited by: Jai Shankar
Hi,
Did you change the context to root level ? I think that may be a problem in your case.. try out these .. Also some builtin functions like SplitByValue, RemoveContext may help you to figureout this.
So best way to debug this is to go with Context Queues in the mapping editors. To help in debug-
/people/venkat.donela/blog/2005/06/09/introduction-to-queues-in-message-mapping
Regards,
Moorthy
Hi All,
Thanks a lot for the helping hnads.... Yes the issue got resolved when I cahnged the context of <val1> node to <type>. Earlier it was <root>. Thanks again....
P.S: Guys there is another question that is a follow up of the same knd of issue...
Regards,
Jai Shankar.
Message was edited by: Jai Shankar
Hi,
In mapping of val1. Please do it directly without if without else (val1->tval). It should work.
Regards,
Wojtek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
tval is inside some node which is created only based on some condition. So if condition is not fullfilled you won't have tval inside(because this mapping won't be even touched). If condition is fullfilled you will have correct number of tval.
By the way put this "if" condition on your top access element.
Maybe you will have to use useOneAsMany for the output of the comparision with constant.
Regards,
Wojtek
Message was edited by: Wojciech Gasiorowski
Wojtek,
Can you pls explain your point with ref to my scenario??
>>>>By the way put this "if" condition on your top access element.
Maybe you will have to use useOneAsMany for the output of the comparision with constant.
I dint get what you mean by top access element and where to use useOneAsMany???
Pls explain it with ref to our scenario...
Thanks & Regards,
Jai Shankar.
User | Count |
---|---|
84 | |
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.