Leonardo,

   First, I believer there is a misconception in your reasoning: creating sessions is supposed to be much much cheaper than retracting all facts. Creating a rulebase is heavier, because it requires compilation, but creating a session is supposed to be very light by design. So, first thing you should do is change that.

   Regarding your question, if you insert:

SiteLanguage(language : languageCode)
t : SiteSpecialServiceType(type : specialServiceType)

   The rule will activate and fire. If you don't, then the rule will not match. That is how it is supposed to work.

   Edson

2009/11/17 Leonardo Gomes <leonardo.f.gomes@gmail.com>
Hi Guys,

I have the following situation while running a stateful session with Drools 4.0.7:

- I want to test that a fact with a given state doesn't exist;
- It works fine
- At a certain point I have to retract all facts and reinsert them at the stateful session - some of them actually changed and I don't want to recreate the session b/c it's expensive
- Again the fact that didn't exist when I first created the session still doesn't exist

** Problem: This time the rule that verified the non-existence is not fired because I didn't insert any fact that would retrigger it.

Rule example:

rule "022"

when

SiteLanguage(language : languageCode)
t : SiteSpecialServiceType(type : specialServiceType)
not SiteLanguageSpecialServiceType(specialServiceType == type, languageCode == language)
then
                <<consequence>>
end

How could I solve or workaround that?


Thanks in advance,
Leo.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com