Java Snippet Errors

Hey there,

it’s the first time I’m trying the Java Snippet Knode even though I do have some experience in Java. Anyhow, I wrote some Code but I can’t figure out, what the errors mean:

My code as text:
If ($Erzeugnisnr.$.endsWith("-…-…")){
zs1=$Sortierkriterium1$;
If ($Produktstatus, Lebenslauf$ == null){
throw new Abort ("Exception: "+$Produktstatus, Lebenslauf$);
} else {
zsPS=$Produktstatus, Lebenslauf$;
}
}
If (zwischenspeicher1.equals($Sortierkriterium1$)) {
If ($Rumpf$!=null && $Produktstatus, Lebenslauf$ == null)
return zwischenspeicherPS;
}
It says I missed some semicolons and the knode doesn’t get the ‘else’, but I don’t understand why.
I would be very grateful if someone could help me.

Hi @marc432341 and welcome to the KNIME community

Just to start, it seems that the “if” statements are in uppercase “If” (in the code you copied but in the snapshot code too).

Hope it helps.

Best

Ael

3 Likes

Hi @aworker and thanks for your quick response - it did the trick with the ‘else’ and the commas :joy:

1 Like

Great @marc432341 ! Happy it worked :smiley: :+1: !
Best wishes with the rest of the development,
Ael

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.