You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuleweatherRule = newRuleBuilder()
.name("weather rule")
.description("if it rains then take an umbrella")
.when(facts -> facts.get("rain").equals(true))
.then(facts -> System.out.println("It rains, take an umbrella!"))
.build();
Or using an Expression Language:
RuleweatherRule = newMVELRule()
.name("weather rule")
.description("if it rains then take an umbrella")
.when("rain == true")
.then("System.out.println(\"It rains, take an umbrella!\");");
How to get:
...
.when("rain == true")
.then(facts -> System.out.println("It rains, take an umbrella!"))
...
Currently, I have to take it in:
MVELRuleweatherMvelRule = newMVELRule()
.name("weather rule")
.description("if it rains then take an umbrella")
.when("rain == true");
Factsfacts = newFacts();
facts.put("rain", true);
if (weatherMvelRule.evaluate(facts)) {
System.out.println("It rains, take an umbrella!");
}
The text was updated successfully, but these errors were encountered:
In a programmatic way with a fluent API:
Or using an Expression Language:
How to get:
Currently, I have to take it in:
The text was updated successfully, but these errors were encountered: