Hi,<br><br>As I understand, you dont need to put any hibernate class in guvnor. Just try that:<br><br>Implement  a global class in your rule engine(not guvnor) with a method that uses hibernate (for example getEntity(EntityName, Id)), then load the engine in the same scenario as guvnor (JBOSS) and add a global class in your package manually (if your global class is com.rule.engine.global.Global then write the complet name in the global class of the guvnor package), save and validate and make sure that  the package is correctly validated without any error or warning. Now you can use the Global class of your engine in guvnor bussiness rules as normal ;)<br>
<br>Then, for using your own global class you have toput it into the working memory as follows:<br><br>        Properties props = new Properties();<br>        props.put(&quot;url&quot;, rulePackagePath);        <br>        agent = RuleAgent.newRuleAgent(props);<br>
        session = agent.getRuleBase().newStatefulSession();<br>com.rule.engine.global.Global global = new com.rule.engine.global.Global();<br>        session.setGlobal(global.getClass().getSimpleName(), global);<br><br>Hope to help you,<br>
<br>NEStor<br><br><div class="gmail_quote">2009/3/27 Anu@work <span dir="ltr">&lt;<a href="mailto:anupama.vaid@bluecasa.com">anupama.vaid@bluecasa.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;">
<br>
Thx. Figured that part and I did that in the source code of the execution<br>
server on a particular XML value coming from client.<br>
<br>
I suppose now I have to put hibernate in Guvnor&#39;s classpath, declare a<br>
global variable in the package configuration and then use it in a rule.<br>
<br>
One thing I cannot figure out is where to put the hibernate xml config file<br>
in guvnor. Can you help?<br>
<br>
Thx<br>
<div><div></div><div class="h5"><br>
<br>
Mark Proctor wrote:<br>
&gt;<br>
&gt; Anu@work wrote:<br>
&gt;&gt; I am trying to use drools to evaluate the following rule:<br>
&gt;&gt;<br>
&gt;&gt; Given a telephone number, if the telephone number already exists in<br>
&gt;&gt; database<br>
&gt;&gt; and has a balance &gt; 0, set isAllowed = false.<br>
&gt;&gt;<br>
&gt;&gt; Looking at forum posts I understand that this can be achieved using<br>
&gt;&gt; hibernate and &#39;from&#39; keyword. However, this is my current scenario - I<br>
&gt;&gt; create a package snapshot for my rules in Guvnor and use the URL in<br>
&gt;&gt; Drools<br>
&gt;&gt; execution server. Execution server runs only stateless sessions.<br>
&gt;&gt;<br>
&gt;&gt; Where and how do I use hibernate named queries?<br>
&gt;&gt;<br>
&gt; set the hibernate session as a global and then the &#39;from&#39; can access it.<br>
&gt;&gt; Thx,<br>
&gt;&gt; Anu<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
&gt;<br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Guvnor-and-%27from%27-database-tp22745198p22747661.html" target="_blank">http://www.nabble.com/Guvnor-and-%27from%27-database-tp22745198p22747661.html</a><br>
</font><div class="im">Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">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>
</div></div></blockquote></div><br>