Skip to main content

Equation

The value associated with the given (key) shall satisfy the specified (equation).

Parameter table

paramunitrequireddescription
eqKeysyesThe keys of the values to check against an equation.
equationyesThe equation to satisfy.

How to setup

The rule verifies whether the values associated with the specified (eqKeys) satisfy the specified (equation). If the equation/inequality is not satisfied, the rule will fail.

The equation/inequality is specified as a string, where the left side is separated from the right side by a symbol. The symbol can be one of the following: =, ==, !=, , <=, >, <, >=. Each side can be a simple arithmetic expression, or a complex equation.

Note: Make sure your variables are consistent with the keys you specified in eqKeys.

Examples

valuevalideqKeysequationdescription
\{x: 5, y: 5, z: 10\}(x, y, z)x + y = zThe equation is satisfied.
\{x: 5, y: 6, z: 10\}(x, y, z)x + y = zThe equation is not satisfied.
\{x: 5, y: 5, z: 10\}(x, y, z)x + y ≤ zThe inequality is satisfied.
\{x: 5, y: 6, z: 12\}(x, y, z)x + y ≥ zThe inequality is not satisfied.
\{hardwork: 6, skill: 5\}(skill, hardwork)skill < hardworkThe inequality is satisfied.
\{power: 10, speed: 5, strength: 5\}(power, strength, speed)power > strength + speedThe inequality is not satisfied.