<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>I avoid knowledge agents myself. It doesn’t take a lot of code to build a knowledge base, and I like to have a more deliberate ‘push’ of new/updated rules. When I'm not planning on changing rules, I just load them from the classpath. If I intend to change them at runtime, then I load them from a URL.</div><div><br></div><div>Steve</div><div><br></div><br><div><div>On 8 Nov 2013, at 16:51, Laird Nelson &lt;<a href="mailto:ljnelson@gmail.com">ljnelson@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>On Fri, Nov 8, 2013 at 8:37 AM, darrell.pittman <span dir="ltr">&lt;<a href="mailto:darrell@darrellpittman.ca" target="_blank">darrell@darrellpittman.ca</a>&gt;</span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello,<br>
<br>
I am new to Drools a starting a new Java EE 6 application that will use<br>
drools. &nbsp;We are not using Guvnor. &nbsp;I am wondering what is the suggested way<br>
of creating the knowledge agent and where to cache it. &nbsp;EJB's shouldn't read<br>
from the file system so I guess a Singleton EJB is out as far as loading the<br>
knowledgebase goes. &nbsp;Should I load knowledgebase in a ServletContextListener<br>
and store it in the ServletContext and pass it into my EJB's? &nbsp;What is the<br>
recommend practice?<br></blockquote><div><br></div><div>I faced the same problem. &nbsp;There is surprisingly little information on how people do this. &nbsp;The next issue you're going to face is when or if to serialize sessions (recreating them on every request is too expensive). &nbsp;Then you're probably going to run into issues with how to get the KnowledgeBase if your KnowledgeAgent discovers a new one.<div>
<br></div><div>The "correct" way (Java EE-approved) to get the KnowledgeAgent working is to use it via a resource adapter, because KnowledgeAgent uses the filesystem and threads, both of which are no-nos in a Java EE environment. &nbsp;It just so happens I wrote one a long time ago:&nbsp;<a href="https://github.com/ljnelson/drools-jca">https://github.com/ljnelson/drools-jca</a> &nbsp;I can't vouch for whether it is entirely correct (JCA is a black art) but it worked for me.</div>
<div><br></div><div>Do let us know how you end up proceeding with your architecture.</div><div><br></div><div>Best,</div><div>Laird</div></div></div><div><br></div>-- <br><a href="http://about.me/lairdnelson" target="_blank">http://about.me/lairdnelson</a><br>

</div></div>
_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users</blockquote></div><br></body></html>