|
|
|
@ -5,8 +5,8 @@ import org.jeasy.rules.api.Rule;
|
|
|
|
|
import org.jeasy.rules.api.Rules;
|
|
|
|
|
import org.jeasy.rules.api.RulesEngine;
|
|
|
|
|
import org.jeasy.rules.core.InferenceRulesEngine;
|
|
|
|
|
import org.jeasy.rules.core.RuleBuilder;
|
|
|
|
|
|
|
|
|
|
import static org.jeasy.rules.core.RuleBuilder.aNewRule;
|
|
|
|
|
import static org.jeasy.rules.tutorials.airco.DecreaseTemperatureAction.decreaseTemperature;
|
|
|
|
|
import static org.jeasy.rules.tutorials.airco.HighTemperatureCondition.itIsHot;
|
|
|
|
|
|
|
|
|
@ -18,8 +18,8 @@ public class Launcher {
|
|
|
|
|
facts.put("temperature", 30);
|
|
|
|
|
|
|
|
|
|
// define rules
|
|
|
|
|
Rule airConditioningRule = aNewRule()
|
|
|
|
|
.named("air conditioning rule")
|
|
|
|
|
Rule airConditioningRule = new RuleBuilder()
|
|
|
|
|
.name("air conditioning rule")
|
|
|
|
|
.when(itIsHot())
|
|
|
|
|
.then(decreaseTemperature())
|
|
|
|
|
.build();
|
|
|
|
|