cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Fields in UDF with Others Outside the UDF

Former Member
0 Kudos

I need to create a UDF that outputs 3 fields to the target structure using "all values in queue" but there are another 3 fields that can map directly to a single field in the target structure. When I tried to do this, the data through the UDF was misaligned with the data that was directly mapped. I solved this by passing the direct map fields into the UDF also but this becomes a problem in my next mapping as the number of fields starts to grow.

The image shows what I really need to do, at this works. But when I take the direct mapped values out and map them independently, the data is out of sync. Thanks for the help.

Accepted Solutions (0)

Answers (3)

Answers (3)

stefan_grube
Active Contributor
0 Kudos

Without knowing the UDF code, it is not possible to help you. However, I see a Hashtable declaration in the UDF. I think it is not possible to do a mapping of the mentioned fields directly without UDF.

Former Member
0 Kudos

The UDF uses all values in queue. loops through the input values, looks up 3 related values and outputs them with a context change between each set. I had to add the direct mapped fields to this loop and output them inside of each context change. If I mapped them directly outside the UDF the context did not match, sync with the data in the udf. There is no real complexity to this. I'm unable to access this code at the moment, the vpn to the system is down. But, the image pretty well captures the situation PLUS the udf uses all values in queue. Perhaps I should go back and try this again if, in "Theory" this should work.

apu_das2
Active Contributor
0 Kudos

what issue are you facing ...Just drag the sender and targets in mapping editor area nd do the mapping .I dont think there should have any issue.

Thanks,

Apu

Former Member
0 Kudos

When I first tried this with the direct map fields mapped outside the UDF, the data did not match the data going through the UDF. I assumed the context was lost on the direct mapped fields was the problem since the UDF used "all values in queue".

former_member190293
Active Contributor
0 Kudos

Hi Carlton!

Wouldn't you please provide an example of source data and desired output?

Regards, Evgeniy.

Former Member
0 Kudos

The input data is just what you see on the right in the image, the red arrows show how the data is mapped. I mentioned that the udf is "all data in queue".

Former Member
0 Kudos

When I first tried this with the direct map fields mapped outside the UDF, the data did not math the data going through the UDF. I assumed the context was lost on the direct mapped fields was the problem.

former_member190293
Active Contributor
0 Kudos

Hi Carlton!

It would be nice to take a look at example of source XML filled up with some data and result XML with that data transformed and arranged according to your mapping logic.

Now we can see only several elements given with no reference to its contexts in message structure and just a part of UDF code.

Regards, Evgeniy.