cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Target Node

Former Member
0 Kudos

Hi,

I have a sinario where i need to create the Target Node when the Source Node is equel to some constant

Eg:

Source

<Node1> it is 0 to unbounded

<Number>

<Code>

</Node1>

If Number = x and Code = y then target node is to be created other wise no.

I have used it with node function "creatif" but when we use with creatif it is testing only once but node1 will be populated unbounded.

Is that we need to write any UDF...if so can you provide the code...

Thanks

Amaresh

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member184619
Active Contributor
0 Kudos

Hi Amresh,

Just cross check your mapping..

Check this blog.

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

Sachin

Former Member
0 Kudos

Write an UDF.

Input: a=Node1

b= Number

c= code

for(i=0;1<a.length;i++)

{

if(b[0].equals("X") and c[0].equals("Y"))

{

result.addValue("true");

}

else

{

result.addValue("false");

}

}

now pass this output to if condition so if the condition is true it will generate a node otherwise it will suppress the node.

Thanks and Regards,

Chirag Gohil

Former Member
0 Kudos

hi amaresh,

set context of number and code to the parent node of Node1 (currently the context of number and code mst be node1)

then use equalsS for both to check if they have 'x' and 'y' values and then use ifWithoutElse followed by splitbyvalue (if required i.e. if u need these values in a target structure in separate contexts) and map to target node.

this shud solve ur problem.

[reward if helpful]

regards,

latika.

justin_santhanam
Active Contributor
0 Kudos

Amaresh,

Can u give us the target structure?

raj.

former_member189558
Contributor
0 Kudos

It is because of the context you set your source node at.

Try setting the context at higher higherarchy.

I do not think you need to use creatif either.

Just check for the source node value and using the ifwithout else function populate a blank constant to the target node.

Thanks,

Himadri

former_member214364
Active Contributor
0 Kudos

Hi Amaresh,

Could you please tell me how you did this mapping? because it should work for multiple occurrences of source node.

i look forward to hearing from you.

Cheers,

Jag