Can't use boolean variable in Java Snippet

Title says it. The problem here is configuring and if switch. With the old Boolean input, the selection could be changed to “top” or “bottom” in a string replacer or java snippet. But the new Boolean Configuration returns a boolean variable which can’t be used in either and also not in the IF switch.

As a workaround you have to use Variable to Table Row and then make a new String flow variable using boolean column. This even more impractical than before and means editing existing Components beyond just replacing the Inputs with Configurations.

Ideally there would be a If switch that worked directly with boolean input.

Hi there @beginner,

did I get it right that you are defining “top” or “bottom” based on input from Boolean Configuration?

For support regarding new flow variables check this topic:

In addition maybe this node from Vernalis KNIME Nodes Extension can help:

Br,
Ivan

Yes or actually it’s a node on KNIME hub I think from Tobias which I updated from Quickforms to configurations. Anyway using Boolean Config with IF switch seems like a very logical fit.

Hi @beginner,

not a developer but backward compatibility might have issues with that idea :smiley:

But I agree with you that there is a need for node that could deal with (modify) new flow variables type and/or create new ones without going into table format and back. If I am not missing something here :wink:

Maybe you can do some workaround with Value Selection Configuration node?

Br,
Ivan

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