# Numeric predicate

Process

Evaluates a numeric input against a configured comparison operator and reference value(s), outputting a boolean result.

Numeric predicate
V
O

# Inputs

IDAbbrevNameTypeDefaultDescription
valueVValueNUMBER0The numeric input value to be evaluated against the configured operator and reference value(s).

# Outputs

IDAbbrevNameTypeDefaultDescription
outputOOutputBOOLEANfalseA boolean output that is true when the input value satisfies the configured comparison, and false otherwise.

# Configuration

IDNameTypeDefaultUnitDescription
operatorOperatorENUM0The comparison operator used to evaluate the input value against the configured reference value(s).

Details:

Values: Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between
operandOperandNUMBER0.0The reference value used for comparison with the input. For the 'Between' operator, this serves as the lower bound of the range.

Details:

Visible whenoperator = Greater than, Greater or equal, Equal, Not equal, Less than, Less or equal, Between
operand_2Operand 2NUMBER0.0The upper bound of the range for the 'Between' operator. The comparison is inclusive: output is true when the input value is greater than or equal to operand AND less than or equal to operand_2.

Details:

Visible whenoperator = Between
> operand

# Source Code

View Volang source
value = input::get("value")
operator = config::get("operator") // 0=GT, 1=GTE, 2=EQ, 3=NEQ, 4=LT, 5=LTE, 6=Between
operand = config::get("operand")

result = false

if (operator == 0) { // Greater than
    result = value > operand
} else if (operator == 1) { // Greater or equal
    result = value >= operand
} else if (operator == 2) { // Equal
    result = value == operand
} else if (operator == 3) { // Not equal
    result = value != operand
} else if (operator == 4) { // Less than
    result = value < operand
} else if (operator == 5) { // Less or equal
    result = value <= operand
} else if (operator == 6) { // Between (inclusive)
    operand_2 = config::get("operand_2")
    result = (value >= operand) and (value <= operand_2)
}

output::set("output", result)
Evaluates a numeric input against a configured comparison operator and reference value(s), outputting a boolean result.