Search in sources :

Example 1 with InferenceRulesEngine

use of org.jeasy.rules.core.InferenceRulesEngine in project easy-rules by j-easy.

the class Launcher method main.

public static void main(String[] args) {
    // define facts
    Facts facts = new Facts();
    facts.put("temperature", 30);
    // define rules
    Rule airConditioningRule = new RuleBuilder().name("air conditioning rule").when(itIsHot()).then(decreaseTemperature()).build();
    Rules rules = new Rules();
    rules.register(airConditioningRule);
    // fire rules on known facts
    RulesEngine rulesEngine = new InferenceRulesEngine();
    rulesEngine.fire(rules, facts);
}
Also used : InferenceRulesEngine(org.jeasy.rules.core.InferenceRulesEngine) InferenceRulesEngine(org.jeasy.rules.core.InferenceRulesEngine) RulesEngine(org.jeasy.rules.api.RulesEngine) Rule(org.jeasy.rules.api.Rule) RuleBuilder(org.jeasy.rules.core.RuleBuilder) Rules(org.jeasy.rules.api.Rules) Facts(org.jeasy.rules.api.Facts)

Aggregations

Facts (org.jeasy.rules.api.Facts)1 Rule (org.jeasy.rules.api.Rule)1 Rules (org.jeasy.rules.api.Rules)1 RulesEngine (org.jeasy.rules.api.RulesEngine)1 InferenceRulesEngine (org.jeasy.rules.core.InferenceRulesEngine)1 RuleBuilder (org.jeasy.rules.core.RuleBuilder)1