Difference between revisions of "While Node"
(→While Node) |
(→While Node) |
||
Line 12: | Line 12: | ||
# Start of Task | # Start of Task | ||
− | # Set [[Task Variable]] ${count} to 0 (zero). | + | # Set [[Task Variables|Task Variable]] ${count} to 0 (zero). |
# Tests ${count} value is less that 100 | # Tests ${count} value is less that 100 | ||
# Increments ${count} | # Increments ${count} |
Revision as of 15:33, 13 July 2010
While Node
In Presence Tasks, it is impossible to link a Node into an earlier Node in the Execution Path as this leads to infinite recursion.
However looping functionality is often desirable, and the While Node serves this purpose - it will continue to repeat execution of subsequent Nodes as long as the conditions specified are met. This Node is most useful if you wish to repeat a process a certain number of times, or as long as certain other conditions remain true.
Here is an example of a pseudo-Task that uses a While Node:
http://www.international-presence.com/wikidocs/images/while_task.png
This example performs the following:
- Start of Task
- Set Task Variable ${count} to 0 (zero).
- Tests ${count} value is less that 100
- Increments ${count}
- Runs a repetitive Task (100 times).
As long as the While Node test conditions evaluate to true the following Nodes will be executed. As soon as the test evaluates to false it will cede execution. This is an example of Iterative Execution.
Using the While Node
Drag the "While" Task Element from the toolbox onto your Task Edit View. You will then be presented with the following Dialog Box:
http://www.international-presence.com/wikidocs/images/while_dialog.png
You can create conditions by dragging the Variable or Column names from the left hand panel into the main panel. When doing so you will be asked to input the condition:
http://www.international-presence.com/wikidocs/images/while_condition_dialog.png
You can add one or more conditions, and they can be arranged in nested groups separated by and / or logic. This allows you to create a complex condition such as:
Country = USA
AND
State = Nevada
AND (
- City = Las Vegas
- OR
- City = Boulder
)
More detailed information on Rules and Conditions can be found in the Rules discussion.
See Also
Task Elements > Flow Control Task Elements > While Node