If
Routes execution by comparing a value against another.
An action in the Flow Control group.
Its type is action.if.
Declared ports
Section titled “Declared ports”| Port | Label | Flow | Type |
|---|---|---|---|
in |
in | execution in | — |
true |
true | execution out | — |
false |
false | execution out | — |
source |
Source | data in | Any |
value |
Compare against | data in | Any |
Configuration
Section titled “Configuration”| Field | Key | Default | Notes |
|---|---|---|---|
| Type | type |
AUTO |
AUTO, INT, LONG, DOUBLE, FLOAT, BOOLEAN, STRING, DATE_TIME |
| Field | field |
— | — |
| Operator | operator |
EQUALS |
EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, CONTAINS, MATCHES_REGEX |
| Source | source |
— | — |
| Compare against | value |
— | — |
If is the only decision-making node in Easymatic. It compares two values and sends execution down one of two paths.
- The comparison runs when execution reaches the node.
- Exactly one output pulses,
trueorfalse.
Working of If
Section titled “Working of If”- Read the left-hand side from the Source field, or from the
sourceport. - Read the right-hand side from Compare against, or from the
valueport. - Apply the Operator.
- Pulse
trueif the test passes,falseif it does not.
Choosing the Source
Section titled “Choosing the Source”Pick a value node in Source and it is read on demand. Nothing is wired and nothing extra is placed on the canvas.
Wire the source port instead when the value is produced by the graph, such as a field
broken out of a trigger’s event. A connected wire always wins.
Example: run only while the battery is low
Section titled “Example: run only while the battery is low”- Set Source to the Battery Level value.
- Set Operator to “less than”.
- Set Compare against to
20. - Wire the guarded work to
true, and leavefalseunconnected.
Explanation:
- The battery is read at the moment the If runs, not when the macro started.
- An If with only
trueconnected works as a gate.
Conditions Are Not Attached to Nodes
Section titled “Conditions Are Not Attached to Nodes”“Run this only when X” is written as an If in front of the thing being guarded, including in front of a trigger’s branch. Per-node conditions existed in an earlier build and were removed, because nothing on a card showed that one was attached.
Points to Remember
Section titled “Points to Remember”- A comparison against something missing is false, not an error. The macro keeps running
down the
falsebranch. - A source that is neither a value node nor a connected wire fails closed.
- Ordering comparisons parse both sides first. ISO-8601 text does not sort chronologically across time-zone offsets. Equality still compares text.
- Branches that split and rejoin run the joining node once per incoming pulse.