Skip to content

What's New in 2.3.0

Released December 2026 · rulii 2.3.0, rulii-spring 2.3.0, rulii-bean-validation 1.1.0, rulii-explorer 1.2.0 and rulii-bom 2.3.0 are on Maven Central

Several changes in this release alter behaviour. They are marked below and listed together under Behaviour Changes. What 2.2.0 brought is kept further down.

On one thread the engine runs about 8 million rules a second where 2.2.0 ran 1.4 million, and a run allocates about a seventh of the memory, with nothing to change in your rules. What rules accept, reject and report is the same.

Runs per second, one thread 2.2.0 2.3.0
A rule: a condition and an action 1.4 million 8.1 million
A condition with three parameters matched by name 1.9 million 9.1 million
A rule set of twenty rules 57,000 329,000
A rule set of ten built-in validators 38,000 215,000
A rule flow of five steps 272,000 1.5 million
A new RuleContext 766,000 2.6 million
A condition written as a Java script (Janino) 1.5 million 4.2 million

Measured with JMH on one machine, each release from Maven Central. These are measurements of the engine’s own overhead: the rules do almost nothing, so in an application the work inside the rules usually dominates. Optimizing rulii tells where the time was going.

Where it came from:

  • A rule’s method is called through a handle adapted once, instead of one adapted on every call
  • Matching parameters to bindings no longer builds lists and descriptions that nobody reads
  • Conditions and functions still receive their arguments read-only, without copying them when nothing needs a copy
  • Validators.binding(name) and Validators.value(value) read the value directly
  • The built-in type converters are created once, not for every RuleContext
  • A binding’s name is checked character by character, not with a regular expression

Every JavaScript evaluation creates a JavaScript context and closes it afterwards, and creating it is nearly all of what the evaluation costs: a simple condition runs about 7,900 times a second on one thread. A GraalJS factory given GraalJsPoolOptions, or any GraalJS factory when -Drulii.script.graaljs.reuseContexts=true, keeps a pool of contexts instead, and the same condition runs about 160,000 times a second. It is opt-in: a change a script makes inside a built-in (String.prototype.shout = ...) is the one thing a reused context does not undo.

ScriptProcessorManager.getInstance().register(
new GraalJsScriptProcessorFactory("js", "ctx", GraalJsPoolOptions.DEFAULT));

Scripting Support

A Flow-Level Exception Handler Lets the Flow Continue

Section titled “A Flow-Level Exception Handler Lets the Flow Continue”

Behaviour change. RuleFlow.builder().onException(type, body) recovers the failed step and the flow continues with the next top-level step. Up to 2.2.0 the flow ended after the handler. A failure inside a when, forEach or scope abandons the rest of that container and the flow resumes after it. End the handler body with exit() to stop the flow as before.

Exception Handling

Behaviour change. The default value of an optional input parameter of a rule flow or rule set is bound in the run’s own scope and goes with it. Up to 2.2.0 it was left in the caller’s bindings, so the next run in the same context did not evaluate the default again. Code that read a defaulted input from the context after the run binds the value itself first, or returns it with returning(...) or resultExtractor(...).

A Context Built over Another Context’s Bindings

Section titled “A Context Built over Another Context’s Bindings”

Behaviour change. RuleContext.builder().build(other.getBindings()), and so rule.run(bindings), ruleSet.run(bindings) or flow.run(bindings) called from an action with the bindings it was handed, now resolves the reserved ruleContext and bindings to the new context. Up to 2.2.0 they resolved to the other context, which knows nothing of the scopes pushed on the new one. Everything else in the given bindings passes through as before.

  • ValueValidationRule.check(ruleContext, value) decides a value the caller already holds (PASS, FAIL or SKIPPED) without running the rule, and buildViolation(ruleContext, value) builds the violation it would report
  • Behaviour change. decimal no longer accepts leading or trailing spaces unless allowSpace() is set

Built-in Validation Rules

Behaviour change. rulii-bean-validation is an optional dependency of rulii-spring 2.3.0 and no longer comes with it. Add org.rulii:rulii-bean-validation and rulii is the application’s Validator, in place of Hibernate Validator; adding it is the switch. Upgrading from 2.2: add the dependency to keep validating with rulii. rulii.validation.enabled=false turns it off while the dependency stays. JPA keeps validating entities with Hibernate Validator while it is on the classpath.

<dependency>
<groupId>org.rulii</groupId>
<artifactId>rulii-bean-validation</artifactId>
<version>1.1.0</version>
</dependency>

Spring Boot Integration

All 48 Validators in XML, with Their Settings

Section titled “All 48 Validators in XML, with Their Settings”

The eleven validators added in rulii 2.2.0 have XML elements now, and every setting of a validator’s builder is an optional attribute named after the builder method.

<r:uuid binding="orderId" versions="4" letterCase="INSENSITIVE"/>
<r:durationMax binding="session" max="PT8H" inclusive="false"/>

XML Rule Definitions

An @Expr, or any jakarta-el script, written as ${...} is no longer taken for a Spring property placeholder: a scripting language can opt out of the script-text resolver (ScriptProcessorFactory.resolvesScriptText()), and Jakarta EL does. ${...} and #{...} both work. Behaviour change: a property placeholder inside a jakarta-el script is no longer resolved.

Jakarta EL in @Expr and @Bind

A validation call costs a fraction of what it did. A predefined constraint (@NotNull, @Size, @Email and the rest) is checked directly instead of being run through the engine, a class with nothing but such constraints is validated without bindings or a rule flow, and a class with nothing to validate returns at once. On one thread a bean of ten satisfied constraints is validated about 640,000 times a second, where 1.0.0 on rulii 2.2.0 managed 34,000. The annotations, the API and the violations are unchanged. It requires rulii 2.3.0.

rulii-bean-validation 1.1.0

  • rulii-spring: rulii-bean-validation no longer comes with rulii-spring; add the dependency to keep validating with rulii. BeanValidationOptOutConfig is renamed HibernateValidatorConfig.
  • Rule flows: a flow-level exception handler lets the flow continue; exit() in the handler body (<r:exit/> in XML) stops it as before.
  • Rule flows and rule sets: the default of an optional input parameter is not left in the caller’s bindings.
  • Rule context: a context built over another context’s bindings resolves ruleContext and bindings to itself.
  • Validation: decimal, <r:decimal> and @Decimal reject surrounding spaces unless allowSpace is set.
  • Scripting: a Spring property placeholder inside a jakarta-el script is no longer resolved.

A release of fixes. An application on WebFlux without Spring MVC now starts with the explorer’s page on (in 1.0.0 and 1.1.0 it failed with a NoClassDefFoundError), and a warning at start-up in applications with one web stack is gone. It is built against rulii-spring 2.3.0, so its Beans section needs org.rulii:rulii-bean-validation in the application.

rulii-explorer 1.2.0

org.rulii:rulii-bom 2.3.0 pins rulii 2.3.0, rulii-spring 2.3.0, rulii-bean-validation 1.1.0 and rulii-explorer 1.2.0.

Using the BOM

Released November 2026 · rulii 2.2.0, rulii-spring 2.2.0 and rulii-bean-validation 1.0.0.

rulii-bean-validation: Jakarta Bean Validation, Run by rulii

Section titled “rulii-bean-validation: Jakarta Bean Validation, Run by rulii”

The headline of 2.2.0 is a new library. rulii-bean-validation 1.0.0 reads the jakarta.validation constraints on your beans and turns every one of them into a rulii rule: named, described, categorised and tagged, visible in the trace, listable from the registry. To the rest of your code it is a Bean Validation 3.1 provider: a drop-in Validator with the standard constraints, groups, cascading, containers, method validation, the metadata API and message interpolation. A bean annotated for Hibernate Validator validates unchanged. On top of the annotations: @Validate attaches rules, rule sets and flows from a RuleRegistry by name, @Expr adds an inline cross-field condition in any scripting language, and @Bind parameterises a rule per declaration site.

// a RuleFlow in the registry, swappable at runtime
@Validate("orderRules")
@Expr(value = "#{end.isAfter(start)}", errorCode = "order.dates")
public class Order {
// a rulii rule: "code size must be between 2 and 5"
@NotNull @Size(min = 2, max = 5)
String code;
LocalDate start, end;
}
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
Set<ConstraintViolation<Order>> violations = validator.validate(order);

Bean Validation

ScopedBindings.fork() and RuleContext.fork() create a context for work that proceeds on another thread: the fork shares every scope the caller has at that moment (values set by either side are seen by both), while everything structural stays private: the bindings and scopes it adds are never seen by the caller, and the scopes the caller pushes or pops afterwards do not affect it. Async RuleFlow steps now run on a fork by default (AsyncContextMode.INHERITED), so a rule set or nested flow is safe to launch asynchronously, several at once. RuleSet.runAsync and RuleFlow.runAsync fork the given context before submitting.

Async Execution

LocalBindings: Per-Run Scratch Space for a Rule

Section titled “LocalBindings: Per-Run Scratch Space for a Rule”

A method of a @Rule class that declares a LocalBindings parameter receives a fresh instance for each run, shared by every method of that run: what the pre-condition or the condition binds, the actions read. Nothing in it reaches the caller, recursive and concurrent runs never share it, and it works on an immutable context too.

Building Rules (Declarative)

Formal Result Types for RuleSets and RuleFlows

Section titled “Formal Result Types for RuleSets and RuleFlows”

A rule set’s and a flow’s definition now carry a result type with its origin (ResultType: DECLARED, DERIVED, DEFAULT, UNKNOWN or NONE). State it with resultType(Type) or resultExtractor(Class, Function), or let it be derived from the extractor. A stated type is checked once, at build(), against the extractor’s and error handler’s declared return types.

RuleSets

Jakarta Expression Language & a Default Scripting Language

Section titled “Jakarta Expression Language & a Default Scripting Language”
  • Jakarta EL is a scripting language, registered as jakarta-el (alias jel) when an EL implementation is on the classpath: #{age >= 18}, bindings reachable as bare identifiers or through ctx
  • ScriptProcessorManager.setDefaultLanguage(name) or the system property rulii.script.defaultLanguage declare the language a script is compiled in when none is named; it is never inferred from the classpath
  • getAvailableLanguages() lists what a script can be compiled in right now

Scripting Support

uuid, isbn, ean, luhnCheck, mod10Check, mod11Check, uniqueElements, normalized, codePointLength, durationMin and durationMax, each with a builder and a Validators entry. url gains protocol, host, port and regexp; email gains anyDomain() and a pattern; the temporal rules accept the java.time.chrono calendars. Every value rule now describes what it checks, naming the value (describe()), and takes extra violation parameters (param(name, value)).

Built-in Validation Rules

Registry, Violations, Sources & Performance

Section titled “Registry, Violations, Sources & Performance”
  • RuleRegistry.getByCategory(category) (sub-categories included), getByTags(tags...), getCategories() and getTags() list a registry by what its runnables declare
  • RuleViolation.getParameterValues() returns parameter values as given (the validated value as an object, not its string); every RuleViolations.add/addAll overload routes through add(RuleViolation)
  • SourceDefinition.forField, forMethod and forConstructor record the member an artifact was declared on
  • Performance: a binding’s name is validated once, its id drawn only when asked for; a context’s id is an ordered <jvm tag>-<millis>-<sequence> instead of a UUID; scopes are named with a counter; the validation rules resolve ruleContext and ruleViolations by name first
  • Every validation rule exposes public static final SUPPORTED_TYPES; DecimalMin/DecimalMax report inclusive; digits accepts zero integral digits; the DecimalMax default message is fixed

Breaking changes: AsyncContextMode.SHARED is removed; INHERITED is the default and covers it; a rule set without a result extractor now reports RuleSetExecutionStatus as its result type (it used to report Object), and a script or generic-lambda extractor reports null; context ids and scope names are no longer UUIDs.

rulii Is the Application’s Bean Validation Provider

Section titled “rulii Is the Application’s Bean Validation Provider”

This is how 2.2.0 worked; from 2.3.0 it is opt-in.

rulii-spring 2.2.0 brings rulii-bean-validation in. With Spring Boot’s validation module on the classpath, BeanValidationConfig defines the defaultValidator bean before Boot’s own validation auto-configuration would, pinned to the rulii provider and wired into the Spring rulii context: @Validate names are bean names, constraint validators are Spring beans, mappers and extractors are beans. A Boot application that validated with Hibernate Validator validates with rulii after the upgrade; rulii.validation.enabled=false keeps Hibernate Validator, deterministically.

rulii.validation.enabled=true
rulii.validation.failFast=false
rulii.script.defaultLanguage=jakarta-el

rulii-bean-validation is not a certified implementation and does not run the TCK. The known differences are on the specification coverage page.

Spring Boot Integration

Result Types in XML & Default Language from the Environment

Section titled “Result Types in XML & Default Language from the Environment”
  • result-type="com.example.Total" on <ruleset> and <ruleflow>, or type on <result-extractor> and <returning>, state the result type a script extractor cannot declare
  • The ScriptProcessorManager bean takes rulii.script.defaultLanguage from application.properties
  • Plain el stays SpEL in rulii-spring; Jakarta EL is jakarta-el

XML Rule Definitions

Added a week after the release: org.rulii:rulii-bom 2.2.0 pins the matching versions of rulii, rulii-spring, rulii-bean-validation and rulii-explorer. Import it and leave the versions off the dependencies.

Using the BOM