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);
}
Aggregations