cancel
Showing results for 
Search instead for 
Did you mean: 

udf mapping: any way to detect last processed record?

Former Member
0 Kudos

Hi !

I need to detect inside my java user defined function, in the graphical mapping, if I am processing the last record of my input message, for example to add a trace message about how many records were processed, etc....I know I can detect the first one by mapping a function to the root node...and how about the last one ? are there any internal mapping variables available to recall inside a udf ?

thanks,

Matias

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

one way would be to use a UDF of type queue

which will store all values from your message

this way you can get a total number of records

if you have the total then you know which one is the last one...

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi Michal !

It worked ok.

I made a queue udf function that counts all NON context change values and passes them as result. Then in other function when the last record was detected, I created a trace item.

Thanks !

PD: points were rewarded.

Answers (1)

Answers (1)

Former Member
0 Kudos

I propose you this solution:

create a copy of the node record you want to count (in the message mapping tool, left -click with the on element and "Duplicate Subtree) and map it in order to recover from the Global Container the number in the counter.

Regards,

Sandro

Former Member
0 Kudos

The Michal's solution is more smart and easy then mine.

Regards,

Sandro

Former Member
0 Kudos

Hi !

I tested your solution too, It worked. I will save this one for another case.

Thanks !

Points rewarded.