How to use collection operators in a filter
- Last Updated: March 24, 2022
- 2 minute read
- Corticon
- Version 6.3
- Documentation
In the following examples, all filter expressions use their default filter-only behavior. As detailed in the Rule Writing Techniques topics, the logic expressed by the following three Rulesheets provides the same result:



Even though expressions in the Filters section of the Rulesheet are evaluated before conditions, the results are the same. This is true for all rule expressions that do not involve collection operations and therefore do not need to use aliases, used in this example brevity of expression. Conditional statements, whether they are located in the Filters or Conditions sections, are AND'ed together. Order does not matter.
In other words, to use the logic from the preceding example:
If person.age > 40 AND person.skydiver = true, then person.riskRating = 'high' Because it does not matter which conditional statement is executed first, we could have written the same logic as:
If person.skydiver = true AND person.age > 40, then person.riskRating = 'high' This independence of order is similar to the commutative property of multiplication: 4 x 5 = 20 and 5 x 4 = 20. Aliases work well in a declarative language (like Corticon's) because regardless of the order of processing, the outcome is the same.