cancel
Showing results for 
Search instead for 
Did you mean: 

Use a constant in a UDF with Context or Queue input types

Former Member
0 Kudos

Hi to all,

I have a very simple UDF that has Context (or Queue) as input types. My problem is that I have two inputs which of one is a Constant. Then, I receive a compile error (ArrayIndexOutOfBound caused by the zero length of the queue with the constant in input...)when I try to display the out queue into mapping. The question is...

How can I use a costant as input parameter when the input type is a context or a queue?

Thanks to all!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

The simple thing to do is use map with default node function after your constant. then there will not be proper value as an input to your function.

    • Reward points if it helps you

stefan_grube
Active Contributor
0 Kudos

When you have a constant as input, you can access this with a[0] only.

You can avoid errors by checking if(a.length > 0) ...

Former Member
0 Kudos

Hi Gabriele Morgante ,

don't think much,if input has constant value..

just diclare constant value in field and map it to UDF as one of the inputs..

and read it inside the UDF and do further reqiured mappings..

Regards,

Ramesh.

Former Member
0 Kudos

Hi,

I can't do this! I need to use the "Constant" element provided by default into XI mapping. How can I solve the problem?

Thanks!

justin_santhanam
Active Contributor
0 Kudos

Gabriele,

As well said by Stefan, read the constant by constant[0], it will solve ur problem,

raj.