2017-04-13 553 views

回答

1

Drools項目有一個允許調試的Eclipse插件,但據我所知,Idea中沒有這個插件。

1

託尼點有效(Idea插件不允許調試實際的Drools規則),但請注意,您可以在由Drools角色調用的實際Java方法上放置斷點。以下代碼片段將有所幫助(isRuleApplicable和getAttribute是實際的Java方法):

//salience allows to give rules a priority 
rule "Number of adults in the family" salience 10 
when 
    // condition on eligible is required to avoid endless loop 
    stbFact: Stb() 
    eval(stbFact.getEligible() == null && stbFact.isRuleApplicable("Number of adults in the family") && stbFact.getAttribute("enh_000010", "1", "5")) 
then 
    System.out.println("[Number of adults in the family] Drools Rule has been satisfied (debug purposes)!!!"); 
    stbFact.setEligible(Boolean.TRUE); 
    update(stbFact); 
end