Prerequisites:
Namespaces: InRule.Runtime
Classes: RuleApplicationReference
See Also: Creating a RuleSession with Cache Retention, Adding items into the Cache, Iterating items in
the cache , Working with the Rule Application Cache
References: InRule.Runtime.dll, InRule.Common.dll
// You can check to see if a rule application is compiled
if (!ruleApp.IsCompiled)
{
// Compile functions as well as metadata, if false only the
// metadata is compiled
bool compileFunctions = true;
// Set the cache retention, AlwaysRetain will extend the cache to fit all
// apps compiled with AlwaysRetain
CacheRetention cacheRetention = CacheRetention.AlwaysRetain;
// You can also use a weight to control how an application is retained in the
// cache, a high weight take preference over lower weights - int.MaxValue is the
// same as Always Retain
cacheRetention = CacheRetention.FromWeight(2000);
// Compile the rule app
ruleApp.Compile(compileFunctions, cacheRetention);
}
Comments
0 comments
Please sign in to leave a comment.