Icon

7. Loop on Condition

There has been no title set for this workflow's metadata.

Loop on Condition

This workflow implements a loop cycle on condition, that is a loop that stops when a given condition is met.

It is a game. I think of a number and write it into the Table Creator node. Then I start the loop with a Generic Loop Start node.
In the loop I prompt the user to guess the number I thought. He should write his guess into the String Input Widget node.
If the answer is not right, the user is prompted again till the answer is right OR he has already tried 3 times.
The condition is built by the Rule Engine Variable node into the flow variable "success" and verified by the Variable Condition loop End node. If the condition has been met, the loop stops.

Annotations and comments
  • Workflow: Loop on Condition This workflow implements a loop cycle on condition, that is a loop that stops when a given condition is met. It is a game. I think of a number and write it into the Table Creator node. Then I start the loop with a Generic Loop Start node. In the loop, I prompt the user to guess the number I thought of. He should write his guess into the String Widget node. If the answer is not right, the user is prompted again till the answer is right OR he has already tried 3 times.The condition is built by the Rule Engine Variable node into the flow variable "success" and verified by the Variable Condition loop End node. If the condition has been met, the loop stops. This workflow should be executed as a Data App on the KNIME Business Hub since there the Quick Form node makes the workflow stop to collect the user guess at each iteration.
  • repeat till guessed or attempts > 3
  • guess = correct answer? > 3 iterations?
  • try to guess
  • Solution
  • correct answer
  • repeat till guessed or attempts > 3 collect list of guesses
  • append "guess" to correct answer to display

Nodes

Extensions

Links