Is there a way to make a If Then on Knime

Hi @Bleck ,

Some cases, i used the rule engine and define a variable to set all cases, even the cases that don’t need attention. For each case, I set integer number to identify it… start from “0” to “x” cases.

switchcase.knwf (22.6 KB)

I made it to use as port matches at switch/case nodes… the ports start with “0” and you can add many ports for each case… Just put after the rule engine a table row to variable node and connect just this port at the switch node as flow variable.

image

Here you set the rules/conditions as “IF else sentences”. And save the result as “port” column.

Put the port as flow variable.

I remove the port column from the data path, I don’t need it for going on after.

I bring the flow variable to validate the row and go throw the port value (0,1,2,3…) that i set at rule engine node.

And that’s it… From the switch, for tests, mark the option to see all ports, but for real state, uncheck it for security process, ok?

I understand that it can solve your problem… maybe a quick solution, but you can try others solutions too…

I hope that helped you.

Seeya,

Denis

2 Likes