Hi David.

Unfortunately in 3 there is no equivalent of conditionTested(), mostly due
to the fact that conditions are much more fine grained then in drools 2. In
drools 2 each condition node is equivalent to an eval() (or test node in
Jess terms). However, in drools 3 there are many more efficient ways to
place constraints on facts.
Its possible that we will eventually have "watch fact" type abilities to see
when things are tested (you could do your own now with AOP or hand coding on
the fact objects getters) - or perhaps attach something to an eval() (so it
is similar to drools 2, but eval is only used occasionally, and it could be
misleading).

So no easy answer, I guess we would need to look at what it is you are
building up to get a "story" in your rules. I would assume you are looking
at building up evidence of what fields were tested that caused a rule to
activate? this may be possible with AOP weaving: basically in your facts,
you weave in some logic that notes when/if a field (a getter) was read: then
in the event listener for the rule activation, you look at the results of
those flags, and then reset them before continuing (assuming everything is
single threaded) - just a an idea/sketch.

Michael.

On 11/29/06, Nebinger, David <[EMAIL PROTECTED]> wrote:

 I've got a drools 2.5 based project which, for lack of a better
explanation, builds a story during rules evaluation (more or less a log of
what happened during rules firing, but in a end user readable format).

In investigating upgrading to 3.0, however, I see that the event mechanism
has changed, but I don't see how I can easily change from, for example, the
WorkingMemoryEventListener.conditionTested() to whatever it is supposed to
be in 3.0 (i.e. some sort of activation event?).

In my story builder I can use the conditionTested() method to identify
what condition was tested, what the result of the condition testing was,
etc., and use that information when constructing the story result.

But how do I get similar type of notification from 3.0?

Can anyone provide some pointers as to how I should go about this
conversion?



Reply via email to