cancel
Showing results for 
Search instead for 
Did you mean: 

context change not working

Former Member
0 Kudos

hi,

i am doing a maping between an xsd and message type with structure which has:

1.nested structure

2.source field occurs more than once in thses netsed structure.

fields not having multiple occurence have the same value as in source but the one having mulitple occurence are having different fields.

my context handling not working.

i m using splitByValue and changing the context of source field to its immediate header which is again not working.

can anyone help in this regards

i appreciate quick reply which is needed-thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

As I have understood your problem. You need all the child node( which is under different parent node in the source structure ) under one patent node in the traget structure

In that case, Change the context of the Child node of the source struture to the higest level(i.e all the child node should be in one contex) and map it to the child node of the target.

Regards,

Shwetambari.

Former Member
0 Kudos

i am sorry for this but the below one is source and the above one is target..

thnx

Former Member
0 Kudos

You mean to say, You are able to create the parent node but all the child node are coming in the first parent node. If this is the case then you need to map the child node as folows:

YOu mentioned earlier that there is an ID Filed. If its value changes, the child node should appear in different parent node.

SO 1) Take ID field and use remove context.

2) Use SplitBy value(Property- change by value)

3) Map it to the child node of the target node.

Regards,

Shwetambari.

Former Member
0 Kudos

hi

source

<Root>

-


><Parent Node> 0..unbounded

-


><childe node1> 0..1

-


><childe node2> 0..1

-


><childe node3> 0..1

-


><childe node4> 0..1

target

<Root>

-


><Parent Node1> 1..unbounded

-


><childe node1> 0..1

-


><childe node2> 0..1

-


><Node2> 0..unbounded "item of parent node1"

-


><childe node3> 0..1

-


><childe node4> 0..1

-


><Node3> 0..unbounded ""item of parent node2"

-


><childe node1> 0..1

-


><childe node2> 0..1

-


><Parent Node2> 1..unbounded

-


><childe node1> 0..1

-


><childe node2> 0..1

as per the above structre when chilnode1,2 gets repeated, the values are not correctly populated in respective target feilds

hope m clear

Former Member
0 Kudos

Hi,

I am not able to exactly get your problem. What is the condition on which you are repeating the child node?

Shwetambari.

former_member200962
Active Contributor
0 Kudos

Hi,

changing the context of source field to its immediate header which is again not working

If your source str is as follows:

<SRC>

<Node1>

<Field1/>

</Node1>

</SRC>

then to achieve your goal you need to raise the context of field1 not to Node1 but to SRC...first try using only context change in this manner without using splitByValue or other function...you can have them later (if needed).

Regards,

Abhishek.

Former Member
0 Kudos

hi abhishek i tried:

1.using without splitVal in field also changing context to root rather immediate header

2.i changed it back to immediate header bcos ocurences of node1 was affected in this case.

i mean node1 was supose to occure 3 time along wth field1(has item as well) but by applying this it occured 3 times but only first occurence had field1 and its item not the other 2 occurences.

rgds

former_member200962
Active Contributor
0 Kudos

Hi,

just tell me one thing will the below source structure repeat

<Node>

<Field1/>

</Node>

OR

will the target elements repeat and you want to push the single occurence of Field1 of Source into multiple occurences of target nodes?? bit confused with:(

Regards,

Abhishek

Former Member
0 Kudos

just tell me one thing will the below source structure repeat

<Node>

<Field1/>

</Node>

Abhishek, not the structure but the field inside repeats in 2--3 header at target side.

OR

will the target elements repeat and you want to push the single occurence of Field1 of Source into multiple occurences of target nodes?? bit confused with:(

ya, field at source side occurs multiple times in different headers but with different values.

X

a

b

target side

Y

a

d

Z

a

e

this way. but in my case value of "a" isnt goin in proper header.

siddhesh_pathak4
Contributor
0 Kudos

Hello ,

Check out with the UDF,

I am not sure how this will help as you will not able to paste the structure, but try out with this,

for(int i = 0; a.length>i;i++)
{
for(int j = 0; b.length>j;j++)
	result.addValue(b[j]);
result.addContextChange();
}

Former Member
0 Kudos

Hi,

Please send the source and target structure. I could not get what is your problem?

Regards,

Shwetambari.

Former Member
0 Kudos

thx siddhesh, but i hav applied similar logic at my root level...but let me try wth this too

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

Would you be able to give the source and target structure?

Regards,

Former Member
0 Kudos

hi Mark,

thanks for the reply.

i cant paste it here.

i can sen it at ur mail.

rgds

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

Please refrain from email communications Just give us a preview of your source and target structure, an example is like this:

Source

<Root>

-


><Parent Node> 1..unbounded

-


><childe node> 0..1

etc

Hope this helps,

Regards,

Former Member
0 Kudos

okay Mark,

i will try to explain,

target

<Root>

-


><Parent Node1> 1..unbounded

-


><childe node1> 0..1

-


><childe node2> 0..1

-


><Parent Node2> 0..unbounded "item of parent node1"

-


><childe node3> 0..1

-


><childe node4> 0..1

-


><Parent Node3> 0..unbounded ""item of parent node2"

-


><childe node1> 0..1

-


><childe node2> 0..1

source

<Root>

-


><Parent Node> 0..unbounded

-


><childe node1> 0..1

-


><childe node2> 0..1

-


><childe node3> 0..1

-


><childe node4> 0..1

when i try to check the context at parentNode1,2,3 its occurences gets affected.

like if supoose parent node1 is suppose to occur3 times along with its items i.e parentNode2, parentNode3; it occurs 3 times but in the 2nd and 3rd occurences there are no items in it.

rest the child nodes are mapped wth context chnge to its immediate header using splitVal.

let me knw if nt clear

thnx al

moorthy
Active Contributor
0 Kudos

Hi ,

Did you try giving source field context to root node? if that is not the purpose then also try using removecontext and splitbyValue in combination & check

There is a one doc in SDN by searching this topic- for more infi

Mapping Patterns - Understand Context Handling in Message Mapping - Webinar Powerpoint

Hope it helps, Regds,Moorthy

Former Member
0 Kudos

hi,

in my case:

A

id

x

y

z

similarly B

id

x

t

u

v

so like x, there are more field which get repaeted in different headers liek B.

i have to populate items of A or B as per id value. Which is fine for fields which are not having multiple occurences, but i donno know why values of multiple occurences isnt ok.

x in A has value of x of B header.

m going thru the doc as well.m in pi 7.1

Did you try giving source field context to root node? if that is not the purpose then also try using removecontext and splitbyValue in combination & check

ya i have, didnt work

can splitByVal and collapse Contxt be helpful in this case?

rgds,

Edited by: sdn pi on Apr 2, 2009 5:41 AM