7.6. Short-Term/Long-Term Facts

Short-term facts are the facts asserted into the BRE prior or during rules execution. After the rules have been executed, the facts are removed from the BRE working memory. Short-term facts are most often used because rules typically rely on instance data passed in at execution time. For scenarios in which the same data is required for many BRE executions, long-term facts should be considered, because the setup cost for these facts will be less because they will be cached across BRE execution.

Retrieving data required for rules execution each and every time a rule is executed is perfectly acceptable for small-scale solutions, but can quickly become a major overhead when it's performed many hundreds of times a second, for example.

Short-term facts, as previously mentioned, are asserted into the engine before execution of the rules and are provided each and every time; they are ideally suited for data that changes frequently or is specific to the request being processed. Long-term facts are suitable for scenarios in which different rules policy executions require the same fact data and that fact data is static or at least changes rarely.

Long-term facts are provided by implementing a custom Fact Retriever, which when configured causes the BRE to call into the Fact Retriever at execution time. The Fact Retriever can assert long-term facts into the BRE that will subsequently be cached by the BRE for future use.

The BRE will still call into your custom ...

Get Professional BizTalk® Server 2006 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.