rule-engine

Rule Engine — Visual Editor

The ruleengine-ui module is a Compose Desktop application for authoring rule projects: schema, actions and rules, with validation and evaluation against sample input.

Rules stay plain .rule text at all times. The editor reads and writes the same files you would write by hand, so switching between the visual builder and the code view is lossless.


Running it

From the project root:

./gradlew :ruleengine-ui:run

Run the tests:

./gradlew :ruleengine-core:test :ruleengine-ui:jvmTest

Build everything:

./gradlew build

What the editor gives you

Area What you can do
Sample gallery Open a ready-made project (financial transactions, log filter, product recommendation, access control) without touching the file system
Schema editor Edit fields as a table or as YAML, including nested collection / object members as indented child rows
Rule builder Build conditions visually: field/operator/value rows, AND/OR grouping, not, ignoreCase, and aggregate or arithmetic operands
Code view Edit the DSL directly, with syntax highlighting, autocompletion and inline diagnostics
Diagram view See a rule’s condition tree
Table view Scan all loaded rules, their conditions and their actions at a glance
Test panel Evaluate the rule set against JSON input and inspect the decision tree

Advanced conditions in the builder

A condition row is operand · operator · operand. Each operand is a chip that can be a field, a literal value, an aggregate, or a calculation:

Aggregates and calculations are numeric, so those two operand kinds are offered only when the comparison can be numeric — a text field will not let you build a sum against it. Rows carrying a computed operand are marked with an accent stripe and show the DSL they generate underneath.

Only then-block extract clauses are still code-only; a rule using one opens read-only in the builder with an explanation.


Embedding the core yourself

The UI is a thin layer over ruleengine-core. The same entry points are available to any application:

Step Call
Load a field schema FieldSchemaLoader.loadFromString(content, nameHint)
Load an action schema ActionSchemaLoader.loadFromString(content)
Parse rules Parser(input = rulesText).parseRules()
Validate Validator.validate(asts, schema, actions)
Compile Compiler.compileRules(asts, schema)
Load a whole project ManifestLoader

See the Integration Guide for the full API, error handling and tracing.