<br>   Leonardo, <br><br>   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.<br>
<br>   Regarding your question, if you insert:<br><br>SiteLanguage(language : languageCode)<br>                t : SiteSpecialServiceType(type : specialServiceType)<br><br>   The rule will activate and fire. If you don&#39;t, then the rule will not match. That is how it is supposed to work.<br>
<br>   Edson<br><br><div class="gmail_quote">2009/11/17 Leonardo Gomes <span dir="ltr">&lt;<a href="mailto:leonardo.f.gomes@gmail.com">leonardo.f.gomes@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Guys,<br><br>I have the following situation while running a stateful session with Drools 4.0.7:<br><br>- I want to test that a fact with a given state doesn&#39;t exist;<br>- It works fine<br>- 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&#39;t want to recreate the session b/c it&#39;s expensive<br>

- Again the fact that didn&#39;t exist when I first created the session still doesn&#39;t exist<br><br>** Problem: This time the rule that verified the non-existence is not fired because I didn&#39;t insert any fact that would retrigger it.<br>

<br>Rule example:<br><br> rule &quot;022&quot;<br><br>        when<br><br>                SiteLanguage(language : languageCode)<br>                t : SiteSpecialServiceType(type : specialServiceType)<br>                not SiteLanguageSpecialServiceType(specialServiceType == type, languageCode == language)<br>

        then<br>                 &lt;&lt;consequence&gt;&gt;<br>end<br><br>How could I solve or workaround that?<br><br><br>Thanks in advance,<br>Leo.
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>