- engine/ # Spring Boot application with rule evaluation engine
- compiler/ # StandardQL compiler wrapper and AST implementation
- model/ # Shared domain models
The engine module contains a Spring Boot application that serves as the rule evaluation engine. It
processes business rules and evaluates them against domain objects.
The easiest way to run the engine is using Spring Boot's built-in Docker Compose support:
cd engine
./gradlew bootRunThis will automatically:
- Start an ActiveMQ broker using Docker Compose (configured in
engine/compose.yaml) - Launch the Spring Boot application
- Connect to the ActiveMQ instance for JMS messaging
The application runs on the default Spring Boot port (8080) and is configured through
engine/src/main/resources/application.properties.
Rules are defined in the src/main/resources/rules.yaml file, rules can be added or removed as
needed.
- Rule evaluation runtime
- JMS integration for asynchronous processing
- Function handlers for custom operations (COUNT, SUM, MIN, MAX, etc.)
- Relation resolvers for domain object relationships
The compiler module provides a Java wrapper around the standardql-compiler binary (written in
Haskell). It handles:
- Deserialization of StandardQL's internal language representation
- Construction of an Abstract Syntax Tree (AST)
- Visitor pattern implementation for AST traversal
- Expression and statement model classes
The compiler integrates with the engine to compile and execute rules defined in StandardQL format.
The model module contains standard domain model classes that are shared across all modules:
- Domain entities (Building, Dwelling, Entrance, Permit, Project, RealEstate, Work)
- Rule-related classes (Rule, RuleContext, RuleResult, RuleMetadata)
- Common enumerations and value objects
These models can be referenced by any module in the project, ensuring consistency across the application.
To build all modules:
./gradlew buildTo build a specific module:
./gradlew :engine:build
./gradlew :compiler:build
./gradlew :model:build- Java 21 or higher
- Docker (for ActiveMQ in development mode)
- Gradle (wrapper included)
- Clone the repository
- Ensure Docker is running (required for ActiveMQ)
- Run
./gradlew buildto compile all modules - Start the engine application as described above
The ActiveMQ broker will be automatically managed by Spring Boot's Docker Compose integration when running in development mode.