cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Calls to UDF

former_member181928
Participant
0 Kudos

HI All

I have the following structure for my message type

MT1

-


Elem1 (1..1)

-


Recordsets (0..unbounded)

-


RecElement1 (1..1)

-


RecElement2 (1..1)

I am trying to map RecElement1 to a target field , by using a user defined function which accepts RecElement1 as an input parameter . But i am getting a strange behaviour. The User defined fn gets called twice somehow.

Suppose i have three Recordset nodes . The UDF gets called once for the first node and thereafter it gets called twice for each RecElement1 in the subsequent nodes.

Can anyone help me on this.

Thanks in advance.

regards

Nilesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

what is the context of the RecElement1

for the UDF have u used caching the whole queue or using context

former_member181928
Participant
0 Kudos

HI Arvind

The Context for RecElement1 is Recordsets.

And i am using the value option.

regards

Nilesh.

Former Member
0 Kudos

Did you try to run payload in Message mapping....you can check with input payload and use "Display Queue"....

Let us know the output...

Nilesh

Former Member
0 Kudos

if the error persists

change the context of RecElement1 to top node. use the entire queue in the UDF and use a splibyvalue (or add a context change inside the UDF)

Answers (2)

Answers (2)

Former Member
0 Kudos

Nilesh,

Check Context level of RecElement1 in your mapping. If you set up at header level, funtion will call only once.

Nilesh

Former Member
0 Kudos

You Change the UDF type to Queue to execute only once because for each value it is executing now because its type is VALUE.

Warm Regards,

Vijay