Monthly Archives: January 2018

Drools :: Infinite Loops

Attribute no-loop avoid the re-activation of a rule caused by the RHS of that SAME rule. Attribute lock-on-active avoid the re-activation of a rule NO MATTER what the cause is. Self-Loop Modifications of facts can trigger a new activation of … Continue reading

Posted in drools infinite loop | Tagged | Leave a comment

Drools :: Declaring New Types

To declare a new type, all you need to do is use the keyword declare, followed by the list of fields, and the keyword end. A new fact must have a list of fields, otherwise the engine will look for … Continue reading

Posted in drools declaring type | Tagged | 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

Drools :: working memory modify 1 Example

Environment Drools 7.5.0.Final Rule Keywords: insert, modify Project working-mem-modify-1 – Project Structure App.java public class App { public static void main(String[] args) { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(“wmInsertKsession”); if (ksession == null) { … Continue reading

Posted in drools working memory modification | Tagged | Leave a comment