cancel
Showing results for 
Search instead for 
Did you mean: 

XI Java Mapping

Former Member
0 Kudos

HI Experts,

I have this problem with my UDF. I want to check if a field exists or not. I don't know the right Java syntax for it.

I use

if (ObjectA<i>.equals(""))

{

result.addValue(e<i>);

}

I can't use (objectA.length() >= 0) because I'm using the Queue function that doesn't allow ().

Could anyone help please?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos
objectA.length == 0
Former Member
0 Kudos

Hi, Thanks for the answer but it still doesn't work.

I have the right input in the source but it still doesn't prdouce anything.

The field is existing but it appears as if it is not there.

If (ObjectA.length == 0)

{

result.addValue(e<i>);

}

stefan_grube
Active Contributor
0 Kudos

If you want to check for existence, do it that way:

objectA.length > 0

Former Member
0 Kudos

Hi Yes it works now with >0.

Thanks.

but now occurs another error when several segments comes in the source and the last one has the criterias as I explained before. I get this error: Exception:[java.lang.ArrayIndexOutOfBoundsException: Array index out of range

stefan_grube
Active Contributor
0 Kudos

before you use

result.addValue(e[k]);

you have to check, whether the array has values,

you can do:

if (e.length > k)
  result.addValue(e[k]);

Former Member
0 Kudos

Hi,

the strange part is that ObjectA.length > 1 works but I get the same result when ObjectA doesn't exist. which is not how it should be. It seems that it doesn't care about that condition.

Do you know why?

Thanks

stefan_grube
Active Contributor
0 Kudos

Is your UDF of type "values of a context"?

Otherwise it won't work.

Answers (0)