cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem : UDF

Former Member
0 Kudos

Hi EveryBody,

I have some issue in mapping.Let me explain my scenario.

In my source structure i have a node called sizes which can repeat <b>n</b> times.For each 10 times of sizes i need to create a HDR node in the target.For example if 25 sizes comes i need to have 3 HDR node in the target.

I have written a UDF in which the above situation is handled.

Now the issue is that under target HDR i have 10 fields called EF1,EF2.......EF10.In the source in each sizes node i have a field EF.Now if sizes repeat 10 times i need to pass the field value of each EF in the sizes node to EF1,EF2.......EF10 in the HDR node.Say now if sizes comes 11th time the field EF of the sizes node 11th should go to the EF1 of 2nd HDR and so on... I hope i have made the requirement clear.I need an UDF or somebody can suggest how i can acheive this.

Regards,

Zabiulla

Accepted Solutions (0)

Answers (3)

Answers (3)

aashish_sinha
Active Contributor
0 Kudos

Hi,

try mapping patterns of Summarization.. this will help you.

Like :

Source

<L>

<1>

<2>

<3>

</L>

<C>

<4>

<5>

<6>

</C>

<M>

<7>

<8>

<9>

</M>

Target

<D>

<1>

<5>

<8>

</D>

Mapping patterns can give you target values like this. and if you want to count the number of sizes and the want to do that try UDF , first count and then make mapping patterns.

Regards

Aashish Sinha

PS : reward points if helpful

Message was edited by:

Aashish Sinha

Former Member
0 Kudos

Hi Mohammed,

Do separate mappings for EF1, EF2, EF3....

Take all the EFs from source in an array and pass only the 1st, 11th, 21st...EFs to EF1. Similarly pass only the 2nd, 12th, 22nd.... EFs for EF2 and so on.

You can use a common UDF and pass a constant parameter with values 1,2,3,4... as constants for EF1, EF2, EF3, EF4.... respectively.

Hope this helps.

Divija.

Former Member
0 Kudos

i think u have have handled the UDF by caching the whole Queue

when u finish 10 sizes u create a context change for HDR until u reach 10 u keep creating the EF nodes for HDR

Former Member
0 Kudos

Hi Arvind,

Can u tell me how can i change the context in UDF?

Thanks,

Zabiulla

Former Member
0 Kudos

use method addContextChange() of ResultList

Former Member
0 Kudos

Hi Arvind,

The Question is that i get the values in a queue.How can i idenntify in the UDF which EF is to be mapped to the EF1,EF2 in the target.As of now i am getting only the first value of EF in all the EF1,EF2..EF10 in target.

Regards,

Zabiulla

Former Member
0 Kudos

Hi,

The EFs from the source will be in an array right? You have to loop through the array elements in your UDF and assign it to corresponding EFs in the target. (Hope you are selecting the cache type Context when you create your UDF.)

Regards,

Divija.

Message was edited by:

Divija KN

Former Member
0 Kudos

Hi,

Yes i am Selecting the cache type Context.The Efs in the source will be in an array.I can loop through the array but dynamically how can i map EF of first sizes to EF1 and EF of second sizes to EF2.As there will be only one size in the design and multiple EFs Occurs at runtime in the node.

Thanks,

Zabi