Trace logging on the failing condition of When

226 views
Skip to first unread message

John Vincent

unread,
Jun 25, 2015, 1:44:08 PM6/25/15
to drools...@googlegroups.com
Hi,

We are pretty new to the drools and trying to support an existing application that uses drools. We have a very basic requirement to log all the rule evaluation by drools as there is no current support mechanism to help our customers - whether the rule has a problem or the rule engine is not evaluating the rules properly.

As a first step, we could log all the events when the rule is successful i.e,

rule "ab"
  dialect "mvel"
        when
$systemStatusPolicy: Policy( policyTypeId == 10, name == "CPU_EMMSDB" )
$possibleAlert: PossibleAlert( eventTypeId == 7, name == "CPU_USAGE", size >= $systemStatusPolicy.size )
then
$possibleAlert.setAlert( true, "CPU_USAGE_EMMSDB", "Notify_EMMSDB", "CPU_USAGE_EMMSDB" );
                System.out.println("condition met - success")
end


However, we could not find a way to log the failure evaluation since there is no provision to print the condition of when on the when segment. Please request help/advice to get this implemented.

Regards/Harris

John Vincent

unread,
Jul 2, 2015, 12:53:31 AM7/2/15
to drools...@googlegroups.com
Hi, Could anyone provide some suggestion / advice on my below problem please?

Thanks/Harris

jsf75

unread,
Jul 13, 2015, 5:37:31 AM7/13/15
to drools...@googlegroups.com
Hi John,

I didn't really try yet, but I'm also looking for that kind of feature.

I will recommend you to take a look at the AgendaEventListener which provide a lot of events and some of them will allow you to spy which conditions was involved.

This seems to be only possible with rules and impossible with query.

Keep in touch,

Marian Buenosayres

unread,
Jul 14, 2015, 3:08:03 PM7/14/15
to drools...@googlegroups.com
If you activate trace level logging on "org.drools.*" I think it prints out pretty much anything related to node evaluation. I think it's the closest you can get to logging that info without having to implement a NodeFactory which rewrites nodes.
Reply all
Reply to author
Forward
0 new messages