Skip to content

An akka-jeasy integrated rule engine library which its goal is to implement rule engine in a non blocking manner.

Notifications You must be signed in to change notification settings

rouzbehkarimik/Akka-Jeasy-Rule-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Akka-Jeasy-Rule-Engine

An akka-jeasy integrated rule engine library which its goal is to implement rule engine in a non blocking manner.

How to get Started with AJRE:

  1. Create A message to carry your facts to BaseAkkaRuleActor in that message. this class extends BaseFactsMessage.class and implements Serializable. apply an @FactMessage(validateBy = YourRuleClass.class) to it at class level.
  2. Create YourRuleClass and apply @Rule at class level and specify an @Condition method. also implement the takeRuleAction() method.
  3. Finally in your main class main method add following lines:
        ActorSystem system = ActorSystem.create("worldSystem");
        ActorRef baseAkkaRuleActor = system.actorOf(Props.create(BaseAkkaRuleActor.class),"baseAkkaRuleActor");
      
        // create your facts
        Facts facts= new Facts();
        facts.put("age",17);

        try {
            // pass the apropriate Fact Message to baseAkkaRuleActor
            baseAkkaRuleActor.tell(new AccountOpeningAgeFactsMessage( facts),ActorRef.noSender());
        } catch (Exception e) {
            e.printStackTrace();
            }

now run the code, Tada! you have a non blocking rule engine. also there is a full working example at example package.

  • important notice: a sequence of rule checkings end where the last called rule class return a null as return value of takeRuleAction

About

An akka-jeasy integrated rule engine library which its goal is to implement rule engine in a non blocking manner.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published