百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

evrete

> 编程语言
开源

Evrete 是一款轻量级且直观的 Java 规则引擎。

188 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Evrete 是一款轻量级且直观的 Java 规则引擎。

Evrete

Important!

Check out what's new in version 4.0.0 and read the migration guides at https://www.evrete.org/docs#migration-guide

Note: Java 8 support is being retired

As Java 8 is nearing the end of its life, Evrete will drop Java 8 compatibility starting with version 4.1.0, which will require Java 17 or later. Projects still on Java 8 should stay on the 4.0.x line.

Evrete is a forward-chaining Java rule engine that implements the RETE algorithm and is fully compliant with the Java Rule Engine specification (JSR 94).

Historically designed as a fast and lightweight alternative to full-scale rule management systems, the engine also brings its own mix of features:

Rule authoring

  • Rules can be authored both externally and inline as plain Java code.
  • The engine allows rules to be authored as annotated Java sources, classes, or archives.
  • The library itself is a flexible tool for creating custom domain-specific rule languages (DSL).

Intuitive and developer-friendly

  • Library's type system allows it to seamlessly process any kinds of objects, including JSON and XML.
  • Fluent builders, Java functional interfaces, and other best practices keep developers' code concise and clear.
  • Key components are exposed as Service Provider Interfaces and can be customized.

Performance and security

  • The engine's algorithm and memory are optimized for large-scale and labeled data.
  • Built-in support of Java Security Manager protects against unwanted or potentially malicious code in the rules.

Project home

The official project description, documentation, and usage examples can be found at https://www.evrete.org

Prerequisites

Evrete is Java 8+ compatible and ships with zero dependencies.

Installation

Maven:

xml

    org.evrete
    evrete-core
    4.0.3

Gradle:

groovy
implementation 'org.evrete:evrete-core:4.0.3'

Support for annotated rules (optional)

Maven:

xml

    org.evrete
    evrete-dsl-java
    4.0.3

Gradle:

groovy
implementation 'org.evrete:evrete-dsl-java:4.0.3'

Quick start

Below is a simple example of rule that removes from session memory every integer except prime numbers.

As inline Java code:

…

As annotated Java source file:

java
public class PrimeNumbersDSLUrl {
    public static void main(String[] args) {
        KnowledgeService service = new KnowledgeService();
        Knowledge knowledge = service
                .newKnowledge()
                .importRules(
                        "JAVA-SOURCE",
                        URI.create("https://www.evrete.org/examples/PrimeNumbersSource.java").toURL());

        try (StatefulSession session = knowledge.newStatefulSession()) {
            // Inject candidates
            for (int i = 2; i  System.out.println(o));
        }
    }
}

where the rule itself is stored externally as PrimeNumbersSource.java

For further details see the official documentation

License

This project uses the following license: MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javajavaproduction-rulesreterule-engine

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言