Put partially failing CSV Reader in a Loop Until Successful execution

I have a CSV Reader node that is configured to download data from a link.

For some reason out of 10 runs of the link it proceeds normally 8 times and fails before even reading data to follow the link 2 times.

So I need to make sure this node doesn’t fail. In case if it fails I just need to run it again and with 95% chance it will run successfully. Is there a way I put this CSV Reader node in a loop until it successfully runs? And if so how? What nodes I use and how I connect them?

@alfo19972 welcome to the KNIME forum. You could adapt this example:

2 Likes

Sorry I am new to Knime, and I do not quite understand how to connect everything. So this is a Try/Catch loop, I am getting the general idea, how do I put this in the loop until execution? Where do I place nodes specifically, to have the rest of the nodes running after my CSV Reader Runs? Thank you for your help, I really appreciate it!

@alfo19972 I created a sample workflow. The construct in fact is not as easy as I thought …

What goes into the Component is a Flow Variable with a Path “var_my_file” that would point to the CSV file. The configuration would allow to specify how often the machine should try to open the file.

If something fails it would wait one second and then try again.

In order for the thing to work I have stored the results from the CSV in a temporary table that will be re-loaded at the end if the import of the CSV is successful.

If the success = 1 then this will also serve as the port variable steering the re-load of the temporary file. If there is no success there will be no file and the Flow Variable will be 0.

The counting of the ports starts with 0 so 1 is the second one:

Try - Catch, Loop until a File has successfully been loaded.knwf (199.5 KB)

1 Like

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