Customer Portal

Filter Ext : Referring to parameter index

Comments 2

  • Avatar
    dpavlis
    0
    Comment actions Permalink
    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.
  • Avatar
    avackova
    0
    Comment actions Permalink
    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

Please sign in to leave a comment.