Decision Point Nodes

From PresenceWiki
Revision as of 12:08, 28 January 2011 by Mattpryor (Talk | contribs)

Jump to: navigation, search

Decision Point Node

See also: Switch Node

The Decision Point Node is a simple and quick way to branch the Execution Paths depending on the result of a test. Typically the test will involve data that has reached the Node from earlier in the Task (for example a Presence Variable value), or in some cases some other changeable value such as the current day of the week.

Decision Points are re-usable, so you can create a Decision Point and use it in as many Tasks as you please, or multiple times in the same Task. Any changes to the original Decision Point Node will affect all Tasks that use the Node, and you will receive a warning if this is a case before making changes.

Here is an example of a Task that uses a Decision Point:

In this Task, when the task execution reaches the Decision Point, it will take one of two branches depending on the result of the decision test. This particular Decision just checks to see if the current day of the week is Wednesday, and if so it goes on to execute the "Wednesday Action" path. Otherwise it will execute the "Other Days" path.

This is the most simple form of Decision, where there is a straight-forward true or false result. Other situations can be slightly more complicated and require further explanation, and we will explore those later.

Creating a Decision Node

In order to create a new Decision Node, right click in the Flow Control Elements toolbox and select "Create New > Decision Point" from the pop-up menu. You will then be presented with the following dialog box:

Test Value

This is the value that you wish to test. Typically this will be a Variable, a Data Column or a Function Call result. Or it may be a combination of the above.


This determines the type of comparison to make in order to generate the result for this Node. The options are:

- Equal To

- Greater Than

- Greater Than or Equal To

- Less Than

- Less Than or Equal To

- Between

- Between (Inclusive)

- Matches Pattern (uses regular expressions)

- Test if Null (undefined)

Compare Value

This is the value that is to be compared with the Test Value. In the above example, we are using "Wednesday" as the compare value, and this will return true if the result of the function call (which returns the current day in the week) is equal to this.

Split Results

In addition to using a single value as the Test Value, you can also test multiple values if they are part of a Data Table. For instance, referencing a column value such as :var{COLUMN_A} in Test Value or Compare Value will cause each distinct value of COLUMN_A to be compared to the other operand.

In this instance, the Task will continue along both the true and false execution paths, however the Data Table will be split into the values that match the condition and those that don't.

See Also

Task Elements > Flow Control Task Elements > Decision Point Nodes

Schedule Nodes | Decision Point Nodes | Start of Task | End of Task | Error Handler
Throw Exception | Passive Node | Log Entry | Sleep For n Seconds | While Node | Loop Node |Switch Node
Fork Execution | Join Forked Threads | Start Synch Block | End Synch Block | Event Notification Nodes

Task Elements | Resources