skip to main content
Corticon Studio: Rule Modeling Guide : Building the Vocabulary : Custom Data Types : Enumerations : Using Custom Data Types : Using IN operator with an enumerated list
 

Try Corticon Now
Using IN operator with an enumerated list
When your rule condition or filter are not defined by a range of values, you might have tried use a series of test and logical OR operations to describe the test. For example, entity1.attribute1='This' or entity1.attribute1='That' or entity1.attribute1='TheOther' is long, and could evolve into a very long expression. You can eliminate the use of the long form of enumeration literals by using the in operator's list format to reduce that filter or condition expression to entity1.attribute1 in {'This','That','TheOther'}.
You can go a step further by defining enumerated lists to define even more brisk expressions, where the labels that you choose are abbreviations for the full names. For example, Regions.state in {MA,NH,VT,CT,RI,ME} to qualify only US New England states.
For more information about these features, see the topics in Qualifying rules with ranges and lists