Esteban,<div><br></div><div>   That is not correct. Drools allows for dynamic addition/removal of assets and properly update existing sessions to reflect that.</div><div><br></div><div>   As I explained in the IRC:</div>
<div><br></div><div><div>&lt;etirelli&gt; dranelf: the problem is not &quot;firing&quot; the rules, but the fact that the LHS of the rules is evaluated immediatelly after they are added to the kbase</div><div>&lt;etirelli&gt; dranelf: you will need to define and set your global before loading those rules</div>
<div>&lt;etirelli&gt; just use a separate DRL file that may contain only the global definition</div><div>&lt;etirelli&gt; load it, set the global and then after that load the actual rules</div><div><br></div><div>   Edson</div>
<div><br></div><br><div class="gmail_quote">2010/6/11 Esteban Aliverti <span dir="ltr">&lt;<a href="mailto:esteban.aliverti@gmail.com">esteban.aliverti@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I think that if you modify the kbase, you must recreate all your sessions. You can&#39;t use any session created previous the kbase modification.<div><br></div><div>Best,<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Fri, Jun 11, 2010 at 3:32 PM, dgimenes <span dir="ltr">&lt;<a href="mailto:dranelf@gmail.com" target="_blank">dranelf@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I&#39;m trying to add rules after the Process (workflow) started. That works, but<br>
I wanted the rules to access database data using hibernate.<br>
<br>
So I created a global object to store my EntityManager (I&#39;m using SEAM; it&#39;s<br>
like a Session object).<br>
<br>
The problem is that when I add the KnowledgePackage with the rule that uses<br>
the EntityManager, an exception is thrown because the global is not set.<br>
BUT, if I try to set the global var, I get an exception saying it does not<br>
exist.<br>
<br>
Do you have any idea?<br>
<br>
I&#39;ve seen that when I add the KnowledgePackage to the<br>
StatefullKnowledgeSession the rules are fired, and then I get the exception.<br>
Is there a way to NOT fire the rules after inserting the packages?<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/AddKnowledgePackage-with-rules-that-uses-global-vars-complains-that-the-global-var-is-not-set-tp889311p889311.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/AddKnowledgePackage-with-rules-that-uses-global-vars-complains-that-the-global-var-is-not-set-tp889311p889311.html</a><br>



Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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>
</font></blockquote></div><br><br clear="all"><br></div></div>-- <br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>
</div>
<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>
</div>