Filter Ext : Referring to parameter index

Hi,

does anybody know how to refer to a parameter index in filter expression, e.g. like isnull($2) where $2 is the second field.

The question arise when I use dynamic field names instead of fixed namings.

Any suggestions?

Cheers,
Frank

Well, it is not possible in current version (2.3) of Clover - sorry. We simply didn’t consider this option - even though it is a really simple change.
We will implement it in version 2.4 which is due in few days.

Hi,
in the meantime you can use Reformat instead of ExFilter. Eg. with transform function:


import java.util.Properties;

import org.apache.commons.logging.LogFactory;
import org.jetel.component.CustomizedRecordTransform;
import org.jetel.component.DataRecordTransform;
import org.jetel.data.DataRecord;
import org.jetel.exception.ComponentNotReadyException;
import org.jetel.exception.TransformException;
import org.jetel.metadata.DataRecordMetadata;


public class myTransformation extends DataRecordTransform {
	
	CustomizedRecordTransform transformation;
	
	public boolean init(Properties arg0, DataRecordMetadata[] arg1, DataRecordMetadata[] arg2) throws ComponentNotReadyException {
		transformation = new CustomizedRecordTransform(LogFactory.getLog(myTransformation.class));
		transformation.addFieldToFieldRule("*.*", "*.*");
		return transformation.init(arg0, arg1, arg2);
	}

	public boolean transform(DataRecord[] arg0, DataRecord[] arg1)
			throws TransformException {
		if ((Integer)arg0[0].getField(0).getValue() > 0 ) {
			return transformation.transform(arg0, arg1);
		}else{
			arg1[0].reset();
		}
		return true;
	}

}

you will get empty records for input records which don’t meet the condition