Addons

An Addon is a Java Class performing a unitary action. It’s described by the mother interface IAddon. Each Addon owns a unique identifier (a String) to be referenced in configuration.

MRules accepts six types of addons:

  • Accessors: these objects handle data access(for example, retrieve or set a Java Object property value or perform a mathematic operation).
    They are responsible for transforming date in order to use it correctlu (for example, mathematic operations need numbers)
  • Conditions: these objects evaluate data, or sub Conditions.
  • Operators: these objects perform operations.
    Three types are defined:

    • Logical operators: Combine sub Conditions results.
    • Evaluation operators: Perform data evaluation (comparisons, equalities, inclusions, …).
    • Mathematic operators: Perform additions, substractions, etc … configured in rules.

  • Executables: these objects execute actions. For example, evaluate a condition and depending on the result execute or not other actions.
  • Callables: these objects allow to call mutualized rules. They are the base for the support of functions.
  • Context Factory: Handles Compilation and Execution Context creation, depending on business needs.

Addons are declared via an XML file named « mrules-addons.xml » accessible in the CLASS_PATH (all files with this name are read) :

  • Either directly by their class name.
  • Or via an AddonManager, Object allowing to mass declare Addons.

Library core itself is an Addon.