[rules-users] app-dev 'toe in water' help please

Wolfgang Laun wolfgang.laun at gmail.com
Fri Aug 12 13:30:54 EDT 2011


On 12 August 2011 17:46, FrankVhh <frank.vanhoenshoven at agserv.eu> wrote:

>
>
> The difference between stateful and stateless is basically this:
>   - Stateful: the engine will be able to reevaluate the rules during
> execution, hereby enabling foreward chaining.
>   - Stateless: engine will not do any reevaluations, the state of the facts
> as they come in to the engine, will be considered their fixed state, even
> if
> they are modified.
>

This is not quite right. An org.drools.runtime.StatelessKnowledgeSession is
nothing but a simplifying wrapper for a StatefulKnowledgeSession. The
wrapper restricts you to "execute", after which it is "game over": the
session is a goner. But, while it is doing its rule firing callisthenics it
is behaving just like a StatefulKnowledgeSession.

There is, however, a special mode for running a StatelessKnowledgeSesssion:
"sequential mode". This, then, results in the restrictions described by
Frank, coupled with some performance gains.

-W
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110812/7e76a551/attachment.html 


More information about the rules-users mailing list