[rules-users] Log messages are in not in the expected order

Malinda Kaushalye kaushalye at yahoo.com
Sat Feb 20 02:39:32 EST 2010


Hi All,
Im writing an event driven application where I need to log 
1. When a particular event get triggered. 
2. When a particular event pattern (condition) is matched.

Events are fired both in the Java code as well as within the drools rule RHS. 
Event patterns are matched in the drools LHS.

The issue is the logged message of firing an event is recorded after the LHS evaluation is matched. This happens when the event is fired within the Java code.
e.g. Let's assume there is a precondition  (e1 && e2) of a rule. The event e1 is fired by the Java code and event e2 is fired by the RHS of a rule.
In that case the record sequence is
- e2 fired
- (e1 & e2) evaluated
- e1 fired.

The above seems wrong isn't it? It should be
- e1 fired
- e2 fired
- (e1 & e2) evaluated

I use log4j for logging.  But this is the case even when I tried System.out.println 
Any clue?

Cheers,
Malinda 


      





More information about the rules-users mailing list