I created a workflow with a “table row to variable run for time loop start” node and regardless what i did, it always stopped after 1 iteration. I then replaced this node with the “Generic run-for-time loop start” followed by knimes table row to variable node and then it worked and looped as expected.
So my question is if I was doing something wrong or if there is a bug?
Hint: the variable port attached to a database reader.
That’s really quite strange, as the code underneath those nodes is essentially the same code! Was there any logging/console output? That might help to figure what is happening.
I have created a workflow somewhat doing the same thing I was doing and the issue is the same. See attachment. Maybe it can be even further simplified.Run-for-time bug.knwf (31.8 KB)
Thanks - that is very helpful. So, what is happening?
- In the case of the
Generic Run-for-time Loop Start, the whole table is passed through each loop iteration and loop execution continues until the indicated time condition has been met
- In the case of the
Table Row To Variable Run-for-time Loop Start, there are two ways loop execution can be terminated:
- The time condition has been met, as above. In this case, any rows which were not processed in the loop body will be at the second output port of the loop end.
- All the rows of the incoming table have been processed by the loop body (one row per loop iteration) even though the time condition has not yet been met.
In your example, it is this second condition which is being met - the incoming table’s single row has been processed, and so the loop only executes the once.
I’m guessing that your ‘real’ use case (as opposed to this example) has some sort of connection data which you wish to use each time round the loop, in which case using the
Generic Run-for-time Loop Start /
Table Row to Variable node combination in your top example would be the way to go.
Ok. Makes s a lot of sense with this explanation.
Indeed. The data generator is actually a database reader node.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.