skip to main content
Corticon Studio: Rule Modeling Guide : Filters and preconditions : What is a filter?
 

Try Corticon Now

What is a filter?

A Filter expression acts to limit or reduce the data in working memory to only that subset whose members satisfy the expression. A Filter does not permanently remove or delete any data; it simply excludes data from evaluation by other rules in the same Rulesheet. 
We often say that data satisfying a Filter expression survives the Filter. Data that does not survive the Filter is said to be filtered out. Data that has been filtered out is ignored by other rules in the same Rulesheet. 
A Filter expression, regardless of its full behavior, is unaffected by Filter expressions in other Rulesheets.
As an example, look at the Rulesheet sections shown in the following two figures:
Figure 165. Aliases Declared
The Scope window in this figure defines aliases for a root-level Policy entity, a collection of Driver entities related to that Policy, and a collection of Vehicle entities related to that Policy, named thePolicy, drivers, and cars, in that order.
To start with, we will write a simple Filter and observe its default behavior. In the simple scenario below, the Filter expression reduces the set of data acted upon by the Nonconditional rule (column 0), which in this case merely posts the Rule Statement as a message.
Figure 166. Rulesheet to Illustrate Basic Filter Behavior
Our result is not unexpected: for every element in the collection (every Driver) whose age attribute is greater than 16, we see a posted message in the Ruletest, as shown below:
Figure 167. Ruletest to test Filter Behavior
The policy is issued because there are drivers over 16. But because only Jacob and Lisa are older than 16, Rule Messages are posted only for them.
* Full filters
* Limiting filters
* Database filters