unruly-engine 2.35.3 API

A rules engine for Java: rules are conditions and actions written in an expression language, such as MVEL, that an engine compiles once and runs against your facts from any number of threads.

Where to start

  1. RulesEngineBuilder builds an engine: choose the match policy (firstMatch, allMatches or uniqueMatch), then its languages, imports, listeners and limits.
  2. Rule is a condition, an action and a priority, created with Rule.builder().
  3. RulesEngine.load(java.util.List) compiles a rule list; a broken rule fails there, not during a run. RulesEngine.run(io.github.brantunger.unruly.api.FactStore) runs the rules against a FactStore, such as a FactMap.
  4. RuleListener observes each run, condition and action; what load and run throw is in io.github.brantunger.unruly.api.exception.
  5. Writing an expression language starts at io.github.brantunger.unruly.api.language, and testing one at io.github.brantunger.unruly.test.

Modules

  • io.github.brantunger.unruly.core, the artifact unruly-engine-core: the API, the language SPI and the engine, without an expression language.
  • io.github.brantunger.unruly, the artifact unruly-engine: the MVEL language. It requires the core module.
  • io.github.brantunger.unruly.test, the artifact unruly-engine-test: tools for testing an expression language, for its own tests.

The guides: the quick start and the documentation index, which lists a reading order for each kind of reader.

Modules
Module
Description
The Unruly rules engine with the MVEL expression language.
The Unruly rules engine without an expression language.
Tools for testing an expression language: a contract test that any language's tests extend, and the contexts the engine passes to a language, for unit tests of its compiler and compiled expressions.