Category Archives: drools rule attributes

Drools :: activation-group Example

Environment Drools 7.7.0.Final Project structure App.java public class App { public static void main( String[] args ) { // Start a Rule Engine Session KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(); Product product = new … Continue reading

Posted in drools rule attributes | Leave a comment

Drools :: agenda-group Example

Environment Drools 7.7.0.Final Project structure App.java public class App { public static void main( String[] args ) { // Start a Rule Engine Session KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(); kSession.getAgenda().getAgendaGroup(“primary”).setFocus(); kSession.getAgenda().getAgendaGroup(“secondary”).setFocus(); kSession.fireAllRules(); } … Continue reading

Posted in drools rule attributes | Leave a comment

Drools :: Rule Keywords and Attributes

Keywords insert keyword rule “Set Order cost: Low price” when $i: Order(cost < 50.00) then System.out.println(“rule: ‘Set Order cost: Low price’; insert IsLowCostOrder”); insert(new IsLowCostOrder($i)); end new IsLowCostOrder($i) is the data available to the working memory using the insert keyword. … Continue reading

Posted in drools rule attributes, drools rule keywords | Tagged , | Leave a comment