All Projects → hyperjumptech → Grule Rule Engine

hyperjumptech / Grule Rule Engine

Licence: other
Rule engine implementation in Golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Grule Rule Engine

evrete
Evrete is a lightweight and intuitive Java rule engine.
Stars: ✭ 37 (-94.92%)
Mutual labels:  rule-engine
graal
Graal is a Java toolkit for querying knowledge bases within the framework of existential rules, aka Datalog+/-. See Graal's homepage:
Stars: ✭ 38 (-94.79%)
Mutual labels:  rule-engine
Drools
Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
Stars: ✭ 4,062 (+457.2%)
Mutual labels:  rule-engine
ruledesigner
Rule Designer is the Eclipse-based development environment for ODM developers.
Stars: ✭ 14 (-98.08%)
Mutual labels:  rule-engine
NiFi-Rule-engine-processor
Drools processor for Apache NiFi
Stars: ✭ 34 (-95.34%)
Mutual labels:  rule-engine
Easy Rules
The simple, stupid rules engine for Java
Stars: ✭ 3,522 (+383.13%)
Mutual labels:  rule-engine
EngineX
Engine X - 实时AI智能决策引擎、规则引擎、风控引擎、数据流引擎。 通过可视化界面进行规则配置,无需繁琐开发,节约人力,提升效率,实时监控,减少错误率,随时调整; 支持规则集、评分卡、决策树,名单库管理、机器学习模型、三方数据接入、定制化开发等;
Stars: ✭ 369 (-49.38%)
Mutual labels:  rule-engine
Node Rules
Node-rules is a light weight forward chaining rule engine written in JavaScript.
Stars: ✭ 481 (-34.02%)
Mutual labels:  rule-engine
emqx-rule-engine
EMQ X Rule Engine
Stars: ✭ 63 (-91.36%)
Mutual labels:  rule-engine
Gengine
Rule Engine for Golang
Stars: ✭ 348 (-52.26%)
Mutual labels:  rule-engine
IoT-Technical-Guide
🐝 IoT Technical Guide --- 从零搭建高性能物联网平台及物联网解决方案和Thingsboard源码分析 ✨ ✨ ✨ (IoT Platform, SaaS, MQTT, CoAP, HTTP, Modbus, OPC, WebSocket, 物模型,Protobuf, PostgreSQL, MongoDB, Spring Security, OAuth2, RuleEngine, Kafka, Docker)
Stars: ✭ 2,565 (+251.85%)
Mutual labels:  rule-engine
reguloj
Lightweight business rule engine
Stars: ✭ 24 (-96.71%)
Mutual labels:  rule-engine
Irods
Open Source Data Management Software
Stars: ✭ 321 (-55.97%)
Mutual labels:  rule-engine
hmrb
Python Rule Processing Engine 🏺
Stars: ✭ 65 (-91.08%)
Mutual labels:  rule-engine
Jetlinks
JetLinks Core
Stars: ✭ 380 (-47.87%)
Mutual labels:  rule-engine
devs
Devs是一款轻量级的规则引擎
Stars: ✭ 15 (-97.94%)
Mutual labels:  rule-engine
Rule Engine
🔥 🔥 🔥 📌 规则引擎 📌 RuleEngine 基于web可视化配置,简单高效快捷。
Stars: ✭ 256 (-64.88%)
Mutual labels:  rule-engine
Ruler
The Hoa\Ruler library.
Stars: ✭ 612 (-16.05%)
Mutual labels:  rule-engine
Wongi Engine
A rule engine written in Ruby.
Stars: ✭ 414 (-43.21%)
Mutual labels:  rule-engine
Kuiper
A lightweight IoT edge analytics software
Stars: ✭ 327 (-55.14%)
Mutual labels:  rule-engine

Gopheer Holds The Rule

Build Status Build Status Go Report Card License

"Gopher Holds The Rules"

Grule-Rule-Engine

import "github.com/hyperjumptech/grule-rule-engine"

Rule Engine for Go

Grule is a Rule Engine library for the Golang programming language. Inspired by the acclaimed JBOSS Drools, done in a much simple manner.

Like Drools, Grule have its own DSL comparable as follows.

Drools's DRL be like :

rule "SpeedUp"
    salience 10
    when
        $TestCar : TestCarClass( speedUp == true && speed < maxSpeed )
        $DistanceRecord : DistanceRecordClass()
    then
        $TestCar.setSpeed($TestCar.Speed + $TestCar.SpeedIncrement);
        update($TestCar);
        $DistanceRecord.setTotalDistance($DistanceRecord.getTotalDistance() + $TestCar.Speed);
        update($DistanceRecord);
end

And Grule's GRL be like :

rule SpeedUp "When testcar is speeding up we keep increase the speed." salience 10  {
    when
        TestCar.SpeedUp == true && TestCar.Speed < TestCar.MaxSpeed
    then
        TestCar.Speed = TestCar.Speed + TestCar.SpeedIncrement;
        DistanceRecord.TotalDistance = DistanceRecord.TotalDistance + TestCar.Speed;
}

What is RuleEngine

There isn't a better explanation than the article authored by Martin Fowler. You can read the article here (RulesEngine by Martin Fowler).

Taken from TutorialsPoint website (with slight modifications),

Grule Rule Engine is a Production Rule System that uses the rule-based approach to implement an Expert System. Expert Systems are knowledge-based systems that use knowledge representations to process acquired knowledge into a knowledge base that can be used for reasoning.

A Production Rule System is Turing complete with a focus on knowledge representation to express propositional and first-order logic in a concise, non-ambiguous and declarative manner.

The brain of a Production Rules System is an Inference Engine that can scale to a large number of rules and facts. The Inference Engine matches facts and data against Production Rules – also called Productions or just Rules – to infer conclusions which result in actions.

A Production Rule is a two-part structure that uses first-order logic for reasoning over knowledge representation. A business rule engine is a software system that executes one or more business rules in a runtime production environment.

A Rule Engine allows you to define “What to Do” and not “How to do it.”

What is a Rule

(also taken from TutorialsPoint)

Rules are pieces of knowledge often expressed as, "When some conditions occur, then do some tasks."

When
   <Condition is true>
Then
   <Take desired Action>

The most important part of a Rule is its when part. If the when part is satisfied, the then part is triggered.

rule  <rule_name> <rule_description>
   <attribute> <value> {
   when
      <conditions>

   then
      <actions>
}

Advantages of a Rule Engine

Declarative Programming

Rules make it easy to express solutions to difficult problems and get the verifications as well. Unlike codes, Rules are written with less complex language; Business Analysts can easily read and verify a set of rules.

Logic and Data Separation

The data resides in the Domain Objects and the business logic resides in the Rules. Depending upon the kind of project, this kind of separation can be very advantageous.

Centralization of Knowledge

By using Rules, you create a repository of knowledge (a knowledge base) which is executable. It is a single point of truth for business policy. Ideally, Rules are so readable that they can also serve as documentation.

Agility To Change

Since business rules are actually treated as data. Adjusting the rule according to business dynamic nature become trivial. No need to re-build codes, deploy as normal software development do, you only need to roll out sets of rule and apply them to knowledge repository.

Docs

Grule's Documentation now viewable in ViewDocs. http://hyperjumptech.viewdocs.io

Benchmark

Loading rules into KnowledgeBase:

  • To load 100 rules into knowledgeBase it took 99342047 ns/op (took the highest value) that is equal to ~99.342047ms and (49295906 B/op) ~49.295906MB memory per operation

  • To load 1000 rules into knowledgeBase it took 933617752 ns/op (took the highest value) that is equal to ~933.617752ms and (488126636 B/op) ~488.126636 memory per operation

Executing rules against a fact:

  • To execute a fact against 100 rules, Grule Engine took ~9697 ns/op (took the highest value as base) that is hardly ~0.009697ms and 3957 B/op which is pretty fast.

  • To execute a fact against 1000 rules, Grule Engine took ~568959 ns/op (took the highest value as base) that is hardly ~0.568959ms and 293710 B/op which is also pretty fast.

You can read the detail report here

Our Contributors



newm4n




jinagamvasubabu




niallnsec




inhuman




ariya




sapiderman




jtr860830




trancee




liouxiao




Troush




shanhuhai5739




derekwyatt




garychristianto




sourcesoft




sdowding-koho




yomashExpel




avisdsouza




zct




enricoojf




vlean


Tasks and Help Wanted

Yes. We need contributors to make Grule even better and useful to the Open Source Community.

  • Need to do more and more and more tests.
  • Better code coverage test.
  • Better commenting for go doc best practice.
  • Improve function argument handling to be more fluid and intuitive.

If you really want to help us, simply Fork the project and apply for Pull Request. Please read our Contribution Manual and Code of Conduct

Featured Projects Or Products

HYPERJUMP tech ( https://hyperjump.tech )


If your company or project is using Grule right now and don't mind tobe featured here, I would glad to add a name, logo (if you have one) and a link to your site. While it surely help us to know our users, your product might gain awareness by those who passing by. Please submit a "Feature me" issue, stating the company/product name, a link to the page and/or logo in the issue's description.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].