How to use if condition in transform function?
import org.jetel.component.DataRecordTransform;
import org.jetel.data.*;
public class ReformatOrdersInline extends DataRecordTransform{
int counter=0;
int field=0;
public int transform(DataRecord[] source, DataRecord[] target){
System.out.println("Everthing was OK.");
StringBuffer strBuf=new StringBuffer(80);
if (source[0]==null){
System.err.println("NULL source[0]");
}
try{
if(GetVal.getString(target[0],"RECORD_TYPE")=="asd")
{
System.out.println("Everthing was OK.");
System.out.println(GetVal.getString(source[0],"RECORD_TYPE"));
SetVal.setString(target[0],"RECORD_TYPE",GetVal.getString(source[0],"RECORD_TYPE"));
SetVal.setString(target[0],"BILLING_ACCOUNT_NUMBER",GetVal.getString(source[0],"BILLING_ACCOUNT_NUMBER"));
SetVal.setString(target[0],"RECORD_TYPE_PLN_ID",GetVal.getString(source[0],"RECORD_TYPE_PLN_ID") );
SetVal.setInt(target[0],"CHARGE_AMOUNT",GetVal.getInt(source[0],"CHARGE_AMOUNT") );
}
}catch(Exception ex){
ex.printStackTrace();
errorMessage=ex.getMessage()+" ->occured with record :"+counter;
return SKIP;
}
return ALL;
}
}
is this correct??