cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for context changes

Former Member
0 Kudos

Hello Experts

I am using a UDF to create context change and another UDF to supress context changes , But strangely for one particular set of data my target node ignores a context change and jumps to the other context , Messing the whole cardinality.

Have ever faced a sistuation where a context is being ignored from queue? I can see 4 context changes and 4 values in the queue . but only 3 are being used. It ignores the 3rd value and jumps to the 4th value and places it in the 3rd target node leaving 4th node blank.

The udf i used is String[] a



String toCompare = a[0];
int sameValCounter = 0;

for (int i = 0; i < a.length; i++)
{
	if (a<i>.equals(toCompare)) {
		result.addValue(a<i>);
		sameValCounter++;
	}
	else {
		for (int z = 0; z < sameValCounter; z++) {
			result.addContextChange();
		}
		result.addValue(a<i>);		
		toCompare = a<i>;
		sameValCounter = 1;
	}
		
}

Anybody has a solution for this ?

Edited by: sudheer kamepalli on Dec 5, 2009 9:56 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sudheer,

If you give the example then we are very clear.

If you want to suppress the context then use result.addSuppress();

If you want to add the context then use result.addValue(ResultList.CC)

Regards

Ramesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Provide an example value set for ur requirement. That can help understand ur code & tell what might be wrong.