I would to conditionally launch an active start inverterter-node, in case a prior node doesnt’t have any data. By any data I don’t mean that it is empty and has 0 rows, but it not exist at all, for instance because the source file couldn’t be red and if I right click on the data outport, I see the flow variables only.
How to build a condition that tells whether this situation happened?
Thank you
Have you looked at the Empty Table Switch?
Edit: I misread the original post. Seems like the issue is more node failure than empty tables… Try Catch is indeed the way to go.
I take that if a file could not be read because it does not exist, or a sheet that should be read is not there or any other reason, that the reader not throws an error.
The moment you get an error, you can use Try and Catch Nodes to handle this scenario.
Depending on your scenario you may want to use the version of nodes with data ports - example can be found here:
Although given that you likely pass the path to the file to be read in via flow variable, you may need the variable port version:
The principle is the same:
- use a Try node and connect to the reader node that may fail (or to whatever sequence of nodes that may fail)
- Connect the part that may fail to the catch node (top port)
- Connect to the bottom port of catch node the “fall back” scenario that should apply if your reader fails
This is also covered in the L2 course of KNIME - here’s a link to the part of the lecture in the YouTube video series:
yes, but in this case both ports are inactive, so this is not what I am looking for.
Thanks.
@HarryKl you will have to catch and define what should happen in which case. And you will have to account for edge cases.
Maybe you can provide a minimal example to work with.
Thanks a lot, I could solve it witg try-catch
thanks a lot, I learned today something useful