skip to main content
Corticon Studio: Rule Modeling Guide : Writing Rules to access external data : Precondition and Filters as query filters

Try Corticon Now

Precondition and Filters as query filters

When the Enterprise Data Connector is in use, Scope rows in a Rulesheet can act as queries to an external database. When an alias definition is designated as Extend to Database, the scope of the alias is assumed to include all database records in the Entity’s corresponding table. But we often want or need to qualify those queries to further constrain the data returned to Server or Studio. You can think of conditional clauses written in the Preconditions/Filters section of the Rulesheet as placing constraints on these queries. If you are familiar with structured query languages (SQL), then you may recognize these constraints as “WHERE clauses” in a SQL query.
If you are not familiar with SQL, that’s OK. Review the Filters& Preconditions chapter of this manual to learn more about how a Precondition/Filter expression serves to reduce or “filter” the data in working memory so that only the data that satisfies the expression “survives” to be evaluated and processed by other rules on the same Rulesheet. EDC simply extends working memory to an external database; the function of the Precondition/Filter expression remains the same.
For performance reasons, it is often desirable to perform a complete query -- including any WHERE clauses -- inside the database before returning the results set (the data) to Studio or Server. An unconstrained or unfiltered results set from an external database may be very large, and takes time to transfer from the database to Studio or Server. Once the results set has entered Studio’s or Server’s working memory, then Preconditions/Filters expressions serve to reduce (or filter) the results set further before rules are applied. But if we believe the unfiltered results set will take too much time to transfer, then we may decide to execute the Preconditions/Filters expressions inside the database query, thereby reducing the results set prior to transmission to Studio or Server. This may make the entire database access process faster.
* Filter Query qualification criteria
* Operators supported in Query Filters
* Filter Queries: Single Alias
* Filter Queries: Multiple Aliases
* Using multiple filters in Filter Queries