Using the CA Rule Engine › Construction of Java Client Applications › Acquire the RuleExecutionSet and RuleSession
Acquire the RuleExecutionSet and RuleSession
Once the Java classes that wrap the corresponding rulebase classes are properly defined (see Rules for Constructing Java Classes), the main application class needs to be constructed. This class provides methods for acquiring the rule execution sets and establishing a rule session that uses those classes that wrap the rulebase classes. The WrapperMaker tool generated template session class can be used as the starting point for the main application class.
An overview of the required elements in the construction of the main application class includes the following:
- The JSR‑94 related packages that must be imported into the client application. For more information, see JSR‑94 Packages.
- The first step in any client application is to obtain the RuleServiceProvider. The RuleServiceProvider is the entrance to all other services provided by a JSR‑94 implementation. For more information, see Acquire the RuleServiceProvider.
- For all systems, it is necessary to obtain and register a RuleExecutionSet. However, some solution architectures may obtain and register the RuleExecutionSet outside of the application that performs inferencing. For more information, see Acquire and Register the RuleExecutionSet.
- Finally, the application must establish a rule session, which provides an executeRules() method for calling the inference engine with a RuleExecutionSet. For more information, see Establish a Rule Session.