2015-10-20 17 views

回答

0

您可以將AgendaEventListener附加到您的會話並跟蹤執行的AfterMatchFiredEvents

ksession.addEventListener(new DefaultAgendaEventListener() { 
    public void afterMatchFired(AfterMatchFiredEvent event) { 
     super.afterMatchFired(event); 
     //Keep track of the event object. You can get information 
     //such as the name of the fired rule from this object. 
    } 
}); 

採取Drools documentation manual.

希望它可以幫助看看部分4.2.4.4 Event Model

+0

我是否能獲得的多個規則,他們的「當」條款滿足條件的名字? – sharon182

+0

試試看看。每次執行規則的動作(當時)部分時,您都會在偵聽器中收到一個'AfterMatchFiredEvent'實例。 –

相關問題