Components in a loop

Dear friends,

Long time I had no chance to ask simple questions, but today is the day!

I have a workflow (its not even that important what it is used for. Generally speaking, it collects the data from the local folder, process texts and images (the first and second Component) then in a separate workflow I enrich the data with a set of third-party APIs, later the workflow produces the report customizable in views of later two components.

Works perfect to me – I use this workflow rather often. But nothing is too good to be not improved.
I’d like to make this workflow circular to have a chance starting with the very beginning but with the data collected inside the circle. Seemed to be a simple task – I saw that real experts can do with KNIME a kind of magic I don’t even hope to understand ever, but nothing can be simpler than just a loop…

It didn’t work. Absolutely :blush:

The basic reason was obvious – the workflow continues because rows in Table View ones set to “true” are still true at the next loop and the workflow processes the same set of selected values. I tired playing with variables “stopping” the execution of the component, but it also not the right method (or I use it not in the right way).

So, the question is simple:

  • How to make Component view in a loop and ensure that the next step of the loop is not executed before the user makes a choice?
  • How to “uncheck” checked rows in the Table View? With a common “Sting manipulation” node?
  • What’s with Call Workflow in a loop? What if I need to address this workflow several times with different inputs and all this happens in a loop? My attempt showed that the workflow doesn’t “see” the End loop node if between the Start Loop and End loop nodes there’s a Call Workflow node (or ones again I did it not in the right manner).

I’d like to keep the user in the Loop as long as he needs until he checks “proceed further” in appropriate Component view and later work with the data in a new context (workflow).

How do you solve this type of tasks?
Thank you very much for your help and time!

Hi @DmitryIvanov76 ,

The way this is set up, I think it would work if it was running on the front-end (web portal from a Knime server).

In the back end, interaction is hard to implement. I mean, you have to manually open a node for interaction, and that is why these type of interaction within loops are almost impossible. The workflow just keeps running regardless.

And I am guessing you are referring to the back end, that is running the workflow off the Knime AP, correct?

There is a way that I know of where you can get “automatic” interaction, is via java popup windows. You can check on JOptionPane.

I added 3 samples of interaction in this workflow:

The 1st one will popup a window with message as "Message " + current_itteration, like this:

The 2nd one will popup a window that ask you to click “Yes” or “No”, and will popup another window to tell you what you clicked:


Index 0 is for the first button, which in this case is “Yes”, and “No” would return index 1.

The 3rd one will popup a window to ask you for an input:

It will then popup another window to show you what you entered:

These are just a few examples of the interaction you can get on the back end. I’m not saying that they would necessarily solve your issue, but maybe they could help or could be alternatives.

Here’s the workflow: Popup Window.knwf (22.6 KB)


Thank you! I will try working with Java Snippet - it gives hope!
I’m thinking about KNIME server and will certainly purchase the subscription as soon as I will be sure that I will be able to meet the challenge of working with the server. For orientalist with a background in Chinese history even to go that far with KNIME is a huge step forward in programming and IT :slight_smile:


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