on 06-29-2009 4:03 PM
Hi,
i have a message structure like
root
structure 0-unbounded
field1 0-1
field2 0-1
I want to create the same output structure, but if field1 doent exist, the parent structure shouldnt appear. Sounds very simple, but the my problem is: however i map field1 to structure, either directly or with functions like exists() or ifWithOutElse() it allways give me the wrong structure.
For example:
<root>
<structure>
<field2>10</field2>
</structure>
<structure>
<field1>20</field1>
<field2>30</field2>
</structure>
<structure>
<field2>40</field2>
</structure>
</root>
mapped with field1 (context to root) -> structure gives me as result
<root>
<structure>
<field2>10</field2>
</structure>
</root>
I would like to have:
<root>
<structure>
<field1>20</field1>
<field2>30</field2>
</structure>
</root>
Thx 4 ur help,
Udo
Udo,
The above mapping you can use only when you change the occurence. If you dont want to change the occurence then you can map like this:
For structure map like this: seqno(change context to root) --> removecontext >exists> createif-->structure
For field1 : field1>removecontext>field2
For field2: use if then without else. For if: field1-->exists and for else: field2 and after if then put remove context.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
>For structure map like this: seqno(change context to root) --> removecontext >exists> createif-->structure
What do you mean with seqno? I tried just this with field1 instead of seqno..
>For field1 : field1>removecontext>field2
field1 to field2??
>For field2: use if then without else. For if: field1-->exists and for else: field2 and after if then put remove context.
eh, function ifWithOutElse() has no else branch...
Regards,
Udo
Hi Udo,
My bet. I am using Seqno in my testing instead of field1. So it is a typo. You can use field1.
For target structure map like this: source field1 (change context to root) --> removecontext >exists> createif--> target structure
For target field1 : source field1>removecontext> target field1
For target field2: If source field1-->exists then field2 --> remove context --> target field2.
Hope this works. I mean not your sdn id, your contact id so that I can give screen shot of my testing.
Cheers,
---Satish
Hi Sathish,
your mapping looks very logical. It should work but it does not on my system. The output is like described, it gives me the output of the first structure instead of the second. May be i m temporary blind, should have a break
Do you thing there could be a bug with the release (7.1 / SP 06)?
I changed the profile, my address should now be visible.
Regards,
Udo
Hi Udo,
You can do your mapping like this Udo:
I changed the occurence of your mapping to 0..unbouned in mapping.
For root in target: field1(change context to root in source) > removecontext>exists>creatif>root
For Strucurte in target: field1 > removecontext>exists-->creatif -->Strucurte
For field1 in target: fiedl1>removecontext>field1
For field2 in target: use if then. For if > field1>exists>removecontext and for else field2>removcontext and after if then put a removecontext --> field2.
I tested in my system and it worked but I tested only for this test case. Try for all.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satish,
thx for posting
I checked your solution, but i got the same result, may be i understood something wrong.
>I changed the occurence of your mapping to 0..unbouned in mapping.
I dont understand that. Are you talking about a multi mapping?
>For root in target: field1(change context to root in source) > removecontext>exists>creatif>root
The root is of course occurence 1, so i dont need to map it, right?
>For Strucurte in target: field1 > removecontext>exists-->creatif -->Strucurte
I tried to map the structure like you recommended. It should now give ONLY structures where the child field1 exists. This works, if the first structure has such a child, but not in my example. I get the wrong structure.
Do you think i need to use node functions as well for field1 or field2? Can they appear in a wrong structure?
Regards,
Udo
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.