Constraint Expressions
- Last Updated: August 26, 2025
- 1 minute read
- Corticon
- Version 7.1
- Documentation
When you want to prompt Rulesheet and Ruletest designers to use a specific range of values for an attribute, a constraint expression will validate entries when the associated Ruletest runs.
Constraint expressions are optional for non-enumerated Custom Data Types, but if none are used, then the Custom Data Type probably is not necessary because it reduces to a base attribute with a custom name.
All Constraint Expressions must be Boolean expressions: they must return or resolve to a Boolean value of true or false. The supported syntax is the same as Filter expressions with the
following rules and exceptions:
- Use
valueto represent the Custom Data Type value. - Logical connectors such as
andandorare supported. - Parentheses can be used to form more complex expressions
- The expression can include references to Base and Extended Operators which are compatible with the Base Data Type chosen.
- No Collection operators can be referenced in the expression.
- There should be no references to
null. This is becausenullrepresents a lack of value and is not a real value. The Constraint Expression is intended to constrain the value space of the data type, and expressions such as attributeexpression <> nulldo not belong in it. An attribute that must not have a null value can be designated by selectingYesin its Mandatory property value.
The following are typical Constraint Expressions:
| Constraint Expression | Meaning |
|---|---|
| value > 5 | Integer values greater than 5 |
| value >= 10.2 | Decimal values greater than or equal to 10.2 |
| value in (1.1..9.9] | Decimal values between 1.1 (exclusive) and 9.9 (inclusive) |
| value in [‘1/1/2014 12:30:00 PM’..’1/2/2019 11:00:00 AM’) | DateTime values between ‘1/1/2014 12:30:00 PM’ (inclusive) and ‘1/2/2019 11:00:00 AM’ (exclusive) |
| value in [‘1:00:00 PM’..’2:00:00 PM’] | Time values between ‘1:00:00 PM’ (inclusive) and ‘2:00:00 PM’ (inclusive) |
| value.size >= 6 and (value.indexOf(1) > 0 or value.indexOf(2) > 0) | String values of minimum 6 characters in length that contain at least a 1 or 2 |