cancel
Showing results for 
Search instead for 
Did you mean: 

Help with mapping

Former Member
0 Kudos

I have the following structure

Node1

+Node2 (0....unbounded)

++subNode (0....unbounded)

+++field

++++attribute1(Optional)

+Node3 (0....unbounded)

++SubNode1

+++field1 (0...1)

++++attribute2(Optional)

++subNode2

+++field2 (0....1)

Condition :

attribute1 exists and if is equal to attribute2, then send field2 to target.

As mentioned above, Node2, Node3 can repeat n times.

simple mapping with multiple occurrences of Node2 and Node3 isnt working.

Thanks,

Venkat.

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos
attribute1 -->exists--->
                                       ----> And ---> If(then field2) --> target
attribute2 -->
                -->equalS(TextFunc)
Constant(2)-->

you need to increase the Context of attribute1 and attribute2 to a higher (common node).....or even using remove/ collapse context should help you.

Regards,

Abhishek.

Former Member
0 Kudos

I tried the same before posting here.

The main problem is attribute1 in the above node can appear many times.

But I have only one attribute 2 in the below node. Based on this comparions I need to pick up resepctive field for target this is where I am facing issues.

Thanks,

Venkat.

Former Member
0 Kudos

Should be a problem with equalS(text fnc).

While comparing try keeping the context of attribute1 at node2 level and attribute2 at Node3 level.

Former Member
0 Kudos

I am not sure how copyValue is going to help me.

Node2 and Node3 are at the same level.

Node3 can occur n times. ( Node 2 can also n times, I am filtering with a condition so lets consider that it occurs only one time )

the subNode of Node2 can occur n times so can have n no of attributes.

If its clear till this extent... read below ( else read the above para again )

Pick up repetetion of all the attribute values from Node2, then compare with attribute2 (of node3) each time and when they are both equal, then pick up filed2 from corresponding subNode1.

This is what is making it more complex.

I can filter out the matcing attributes, I am facing issues while picking up the corresponding field.

Thanks,

Venkat.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Venkat,

attribute1(context:Node2)->Mapwithdefault

attribute2(context:node3)->MapWithDefault

Compare the output of both.

Use if-then.

Mapwithdefault will send blank if that node has not appeared.

Regards,

Vishal

Former Member
0 Kudos

Thanks Vishal but i don that is going to help me out.

Node 2 and 3 are at the same level occuring n no of times.

we cannot guarantee that attribute 1 and attribute 2 occurs same no of times.

I dont need extra contexts with mapWithDefault.

Venkat.

Former Member
0 Kudos

First check Node2 and Node3 using exist function and map both the responses to AND. The AND produces resultant queue which contains instances where both Node2 and Node3 exists.This is to match comparions in next steps as Node2 and Node3 are 0..unbounded and the occurance of one node can be greater/lesser of times than the other node.

Now build the logic -attribute1 exists and if is equal to attribute2 for the nodes which is resultant of AND and pass the values to target field.