| |
| netweaver:nodes:if [2020/10/04 16:11] – external edit 127.0.0.1 | netweaver:nodes:if [2020/10/04 18:30] (current) – bjmiller |
|---|
| | ====== Description ====== |
| | The if node selects a value or path based on the value of its first child-node. The mode of operation is dependent on how many child-nodes the if node has. In all cases it is the value of the first (leftmost) node that controls the evaluation. |
| |
| | ^ child-node count ^ returns ^ |
| | | 1 | 0 or 1 | |
| | | 2 | 0 or value<sub>2</sub> | |
| | | 3 | value<sub>2</sub> or value<sub>3</sub> | |
| | | 4 | value<sub>2</sub> or value<sub>3</sub> or value<sub>4</sub> | |
| | |
| | ====== Constraints ====== |
| | * Minimum number of child-nodes: 1 |
| | * Maximum number of child-nodes: 4 |
| | |
| | ====== Calculus ====== |
| | |
| | ===== General ===== |
| | The first (leftmost) child-node is evaluated and compared to the child-node's weight((Weight is a node property that has meaning in only some situations. By default its value is 1, but can be changed to any numeric value.)) to give a meta result. This meta result then determines how the if node will act. (see below) |
| | |
| | ^ value<sub>1</sub> ^ meta result ^ |
| | | ''>''= weight<sub>1</sub> | true | |
| | | ''<'' weight<sub>1</sub> AND ''>'' -weight<sub>1</sub> | undetermined | |
| | | ''<''= -weight<sub>1</sub> | false | |
| | | ERROR | ERROR | |
| | |
| | ===== 1 child-node ===== |
| | |
| | ^ value<sub>1</sub> ^ meta result ^ returns ^ |
| | | ''>''= weight<sub>1</sub> | true | 1 | |
| | | ''<'' weight<sub>1</sub> AND ''>'' -weight<sub>1</sub> | undetermined | 0 | |
| | | ''<''= -weight<sub>1</sub> | false | 0 | |
| | | ERROR | ERROR | ERROR | |
| | |
| | ===== 2 child-nodes ===== |
| | |
| | ^ value<sub>1</sub> ^ meta result ^ returns ^ |
| | | ''>''= weight<sub>1</sub> | true | value<sub>2</sub> | |
| | | ''<'' weight<sub>1</sub> AND ''>'' -weight<sub>1</sub> | undetermined | 0 | |
| | | ''<''= -weight<sub>1</sub> | false | 0 | |
| | | ERROR | ERROR | ERROR | |
| | |
| | ===== 3 child-nodes ===== |
| | |
| | ^ value<sub>1</sub> ^ meta result ^ returns ^ |
| | | ''>''= weight<sub>1</sub> | true | value<sub>2</sub> | |
| | | ''<'' weight<sub>1</sub> AND ''>'' -weight<sub>1</sub> | undetermined | value<sub>3</sub> | |
| | | ''<''= -weight<sub>1</sub> | false | value<sub>3</sub> | |
| | | ERROR | ERROR | ERROR | |
| | |
| | ===== 4 child-nodes ===== |
| | |
| | ^ value<sub>1</sub> ^ meta result ^ returns ^ |
| | | ''>''= weight<sub>1</sub> | true | value<sub>2</sub> | |
| | | ''<'' weight<sub>1</sub> AND ''>'' -weight<sub>1</sub> | undetermined | value<sub>3</sub> | |
| | | ''<''= -weight<sub>1</sub> | false | value<sub>4</sub> | |
| | | ERROR | ERROR | ERROR | |