Ron Kneusel wrote:
I read through the manual, but it is a little too terse regarding when one might choose
Stateless versus Stateful sessions. My initial testing has been with Stateful sessions
and these work nicely but memory use explodes as the number of facts added increases much
So, my questions:
1. Do stateless sessions execute faster than stateful? I'm assuming that even if
they don't, they use memory more effciently?
no. not unless you set sequential mode, but even then it's only faster
if you have a very large number of facts.
2. I read that stateless sessions do not allow for facts to be
modified yet I saw an example online which was using "insert()" in the DRL file.
Will this work if there is a rule that has not already fired but might after the insert?
In a stateless session will a rule only fire once and ignore new facts? (I believe so).
standard statless sessions just wrap a stateful session, so you can't
insert or modify from outside the engine but a rule can insert/modify.
If you run in sequential mode you have no inference, insert/modify do
3. It also seems that a stateless session has no agenda and
therefore will simply fire the first rule that matches so that salience must be used to
prioritize rules. Is this correct?
Standard stateless has an agenda, sequentail has no agenda the rules are
fired in the order they are defined.
3. The difference between a stateless session and a sequential
stateless session is also unclear (to me) from the manual. Can someone explain it?
sequential is a mode in which you can set on the stateless session. It
turns off inference and the agenda for gains on very large rules and
What I am looking to build is essentially a filter, something that
gets a bunch of input facts and applies the rules to see if any alarms should be raised
based on the inputs. My test programs have been using a global which tracks the alarms
raised. I just look at it after the engine has run and use it as my output. Each run of
the rules engine is separate from the previous run, ie, there is no accumulation of
"knowledge", which is why I think a stateless session is the way to go but
I'm not sure.
Any help appreciated!
The i’m Talkathon starts 6/24/08. For now, give amongst yourselves.
rules-users mailing list