I have tried the below code in Java snippet, but it didnt really worked. it gives result as final else statement i gave but not really picking other rules i gave before, can someone help me? what i am doing wrong? knime is not showing any errors but answers are wrong.
// system imports
import org.knime.base.node.jsnippet.expression.AbstractJSnippet;
import org.knime.base.node.jsnippet.expression.Abort;
import org.knime.base.node.jsnippet.expression.Cell;
import org.knime.base.node.jsnippet.expression.ColumnException;
import org.knime.base.node.jsnippet.expression.TypeException;
import static org.knime.base.node.jsnippet.expression.Type.*;
import java.util.Date;
import java.util.Calendar;
import org.w3c.dom.Document;
// Your custom imports:
// system variables
public class JSnippet extends AbstractJSnippet {
// Fields for input columns
/** Input column: “Cust Mapping” /
public String c_CustMapping;
/* Input column: “Customer Type Name” /
public String c_CustomerTypeName;
/* Input column: “Customer Type” /
public String c_CustomerType;
/* Input column: “Source System” */
public String c_SourceSystem;
// Fields for output columns
/** Output column: “Cust Type” */
public String out_CustType;
// Your custom variables:
// expression start
public void snippet() throws TypeException, ColumnException, Abort {
// Enter your code here:
if (c_CustMapping == “Inside Fire”) {out_CustType = “Inside Fire”;
} else if (c_CustomerTypeName == “Internal”) {out_CustType = “Outside Fire”;
} else if (c_CustomerTypeName == “External”) {out_CustType = “External”;
} else if (c_CustomerType == “EXTERNAL” ) {out_CustType = “External”;
} else if (c_SourceSystem ==“SAP”) {out_CustType = “Outside Fire”;
} else {out_CustType = “Outside Fire”;
}
// expression end
}
}