Class RuleEngineManager

java.lang.Object
com.beassolution.rule.engine.RuleEngineManager

@Component public class RuleEngineManager extends Object
Manager class for rule engine operations and caching.

This class is responsible for managing the compilation and caching of rules, functions, and helpers in the Beas Rule Engine. It coordinates the loading and caching of all components needed for rule execution.

Key responsibilities include:

  • Caching helper class instances
  • Caching function library code
  • Compiling and caching rule expressions
  • Managing rule execution context
Since:
1.0
Version:
1.0
Author:
Beas Solution Team
  • Constructor Details

    • RuleEngineManager

      public RuleEngineManager()
  • Method Details

    • cacheHelpers

      public void cacheHelpers(List<RuleHelper> ruleHelpers)
      Caches helper class instances for rule execution.

      This method loads and caches helper class instances from JAR files. The helpers are instantiated and made available for use during rule execution. The cache is cleared before loading new helpers.

      Parameters:
      ruleHelpers - List of rule helper configurations
      Throws:
      OperationException - if helpers list is null or empty
    • cacheFunctions

      public void cacheFunctions(List<FunctionLibrary> functions)
      Caches function library code for rule execution.

      This method caches MVEL function code from function libraries. The functions are stored as strings and will be included in rule compilation. The cache is cleared before loading new functions.

      Parameters:
      functions - List of function library configurations
      Throws:
      OperationException - if functions list is null or empty
    • cacheRules

      public void cacheRules(List<RuleLibrary> rules)
      Compiles and caches rules for execution.

      This method compiles rule libraries into executable MVEL expressions. The compilation process includes helper instances and function code to create a complete execution context for each rule.

      Parameters:
      rules - List of rule library configurations
      Throws:
      OperationException - if rules list is null or empty