Creating a RuleSession

  • Updated

Prerequisites: A valid RuleApplicationReference
Namespaces: InRule.Runtime
Classes:   RuleSession, RuleApplicationReference
See Also: Retrieving a Rule Application, Creating a RuleSession with Cache Retention

The rule session object object that manages all of the rules engine request directives and execution results.  The rule session is used to load state, execute rules, and retrieve notifications, validations, and the execution log.

// Create a session to the rules engine, passing in a RuleApplicationReference
RuleSession ruleSession = new RuleSession(ruleAppRef);

// Use of cache retention
RuleSession ruleSession = new RuleSession(ruleAppRef, CacheRetention.AlwaysRetain);

// Using  Rule Application Definitions  reference to create a rule session
RuleSession ruleSession = new RuleSession(ruleAppDef);

// Using Rule Application Definition that has been saved to file to create a rule session
RuleSession ruleSession = new RuleSession(@"C:\temp\ruleAppDef");

Was this article helpful?

0 out of 0 found this helpful



Please sign in to leave a comment.