Getting Started

What's New in 1.2.0

Released April 2026

New

Scripting Support

Rules, conditions, actions, and functions can now be expressed as scripts in any JSR-223 language (JavaScript, Groovy, etc.). Scripts are compiled once, cached, and evaluated against the RuleContext bindings.

Script<Boolean> script = Script.builder()
    .with("javascript", "ctx.age >= 18")
    .build();

Condition condition = Condition.builder().build(script);
Scripting Support →
New

Validators Static Factory

A new Validators class provides 34 static factory methods — one per built-in validation rule. Each returns a fluent builder for customizing the error code, severity, and message. Use a static import and call binding("fieldName") to look up a binding at runtime.

import static org.rulii.validation.rules.Validators.*;

Rule r = notNull(binding("name"))
    .errorCode("NAME_REQUIRED")
    .build();
Built-in Validation Rules →
Updated

Bindings API Improvements

Three changes to the Bindings API:

  • setValue() now returns the previous value instead of void
  • New setValueOrBind() — sets if the binding exists, otherwise creates it
  • Bindings now implements java.util.Map<String, Object> directly
Bindings →
Spring

SpEL Scripting Integration

rulii-spring auto-configures Spring Expression Language as a scripting processor under the language name "el". No extra setup required — SpEL is available in every RuleContext out of the box.

SpEL Scripting →
Spring

XML Namespace for Declarative Rules

A new Spring XML namespace (xmlns:r="http://www.rulii.org/schema/rulii") lets you declare rules, rulesets, and all 38 built-in validation rules in XML. Useful when business logic needs to live outside compiled code.

<r:ruleset name="RegistrationValidation">
    <r:rules>
        <r:notNull  binding="name"/>
        <r:email    binding="email"/>
        <r:min      binding="age" min="18"/>
    </r:rules>
</r:ruleset>
XML Rule Definitions →
Updated

@RuleScan — xmlLocations

@RuleScan now accepts an xmlLocations attribute. Pass one or more classpath folders and all *.xml files inside are loaded automatically alongside class-scanned rules.

@RuleScan(
    scanBasePackages = "com.example.rules",
    xmlLocations = "classpath:rules/"
)
Rule Scanning & Discovery →