<div dir="ltr">Micheal is right in that using RMI more tightly couples you to the underlying asset object model, but it also gives you a lot of flexibility. For instance, every time our object model changes, as part of the build process, the package is created/updated to include the updated JARS, updated header section, and updated code for the enumerations. It will then validate the package, build it, and create a new snapshot with the version of the model.<br>
<br>To Micheal&#39;s point, I had to update my code to handle the change in the way header is stored in BRMS vs. Guvnor. In BRMS it was a property on the PackageItem, but now it is an AssetItem in the package.<br><br>Here is a sample of connecting to the JCR, then using said session with the Drools API<br>
<br>// THIS first part is JackRabbit&#39;s RMI code<br>ClientRepositoryFactory factory = new ClientRepositoryFactory();<br>Repository repository = factory.getRepository(rmiURL);<br><br>Session session = repository.login(new SimpleCredentials(username, password.toCharArray()));<br>
<br>// THIS IS DROOLS API<br>RulesRepository rulesRepository = new RulesRepository(session);<br><br>With the rulesRepository, you can than get packages out<br><br>PackageIterator iterator = rulesRepository.listPackages();<br>
<br>Create a new package<br><br>rulesPackage = rulesRepository.createPackage(packageName, packageName);<br><br>and so on...<br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 6:13 AM, Asif Akram <span dir="ltr">&lt;<a href="mailto:asif.akram@imperial.ac.uk">asif.akram@imperial.ac.uk</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Dave,<br>
<br>
 &nbsp; &nbsp;Is it possible to share the code snippet with us. I don&#39;t have any experience of Jackrabbit and RMI. Any concrete example will be helpful.<div class="Ih2E3d"><br>
<br>
Cheers<br>
Asif<br>
<br>
David Sinclair wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
Hi Leo,<br>
<br>
I use the Drools API to interact with the JCR with I expose over RMI. I have the security on Jackrabbit, so I log into the JCR, not BRMS. But once the session is established I use the org.drools.repository.RulesRepository to work with BRMS artifcacts as opposed to JCR ones.<br>

<br>
hope that makes sense,<br>
<br>
dave<br>
<br></div><div class="Ih2E3d">
On Thu, Oct 2, 2008 at 3:48 PM, Leonardo Figueiredo &lt;<a href="mailto:leo.lists@gmail.com" target="_blank">leo.lists@gmail.com</a> &lt;mailto:<a href="mailto:leo.lists@gmail.com" target="_blank">leo.lists@gmail.com</a>&gt;&gt; wrote:<br>

<br>
 &nbsp; &nbsp;Hi David,<br>
<br>
 &nbsp; &nbsp;You mean going around Drools Api and acessing the JCR directly?<br>
<br>
 &nbsp; &nbsp;I really wanted the BRMS to expose an interface to add things.<br>
 &nbsp; &nbsp;That would provide more security on upgrading versions without<br>
 &nbsp; &nbsp;breaking functionality.<br>
<br>
 &nbsp; &nbsp;Regards,<br>
 &nbsp; &nbsp;Leo<br>
<br>
 &nbsp; &nbsp;On Thu, Oct 2, 2008 at 11:58 AM, David Sinclair<br>
 &nbsp; &nbsp;&lt;<a href="mailto:dsinclair@chariotsolutions.com" target="_blank">dsinclair@chariotsolutions.com</a><br></div><div class="Ih2E3d">
 &nbsp; &nbsp;&lt;mailto:<a href="mailto:dsinclair@chariotsolutions.com" target="_blank">dsinclair@chariotsolutions.com</a>&gt;&gt; wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Guys,<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;I use the Drools API over RMI. Jackrbait provides an RMI<br>
 &nbsp; &nbsp; &nbsp; &nbsp;implementation to manipulate the JCR, and the Drools<br>
 &nbsp; &nbsp; &nbsp; &nbsp;RulesRepository class works with an open JCR session object.<br>
 &nbsp; &nbsp; &nbsp; &nbsp;Really is a pieice of cake; that is if an RMI solution is ok<br>
 &nbsp; &nbsp; &nbsp; &nbsp;with you. You can always go RMI over HTTP too.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;dave<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;On Thu, Oct 2, 2008 at 2:43 AM, Asif Akram<br></div><div><div></div><div class="Wj3C7c">
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:asif.akram@imperial.ac.uk" target="_blank">asif.akram@imperial.ac.uk</a> &lt;mailto:<a href="mailto:asif.akram@imperial.ac.uk" target="_blank">asif.akram@imperial.ac.uk</a>&gt;&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Hi Leo,<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thanks for your reply. You are absolutely correct, I<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;was talking about API to upload rules, either using<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Restlet API or WebDav Client API or Drools API. I have<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;read the article mentioning the support for Restlet Web<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Services and Webdav but haven&#39;t seen any such example yet.<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;If only Drools Guvnor supports such features, I am fine<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;with Drools 5.0.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Leo, it will be be nice of you if you can share your<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;homemade customized Servlet. Your sharing of ideas and<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;experience will be appreciated.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Cheers<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Asif<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Leonardo Figueiredo wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Hi,<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;You mean using an api to add rules to the BRMS? If so<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i have the same problem. I am using an &quot;homemade&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;build that have a custom Servlet that allows me to<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pass an DRL to be added to the BRMS.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I am still searching for a better solution.<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Regards,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Leo<br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;On Wed, Oct 1, 2008 at 7:00 AM, Asif Akram<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:asif.akram@imperial.ac.uk" target="_blank">asif.akram@imperial.ac.uk</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:asif.akram@imperial.ac.uk" target="_blank">asif.akram@imperial.ac.uk</a>&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:asif.akram@imperial.ac.uk" target="_blank">asif.akram@imperial.ac.uk</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:asif.akram@imperial.ac.uk" target="_blank">asif.akram@imperial.ac.uk</a>&gt;&gt;&gt; wrote:<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hi,<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I was wondering if it is possible to create and<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;upload rules at<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; runtime to BRMS to be accessed by other users. I<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;have only seen<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the examples where existing packages/rules are<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;loaded from the<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BRMS. Any help and suggestion will be appreciated.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cheers<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Asif<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;------------------------------------------------------------------------<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rules-users mailing list<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br></div></div>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<div class="Ih2E3d"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;This message has been scanned for viruses and<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;dangerous content by WATEEN TELECOM, and is<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;believed to be clean.<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rules-users mailing list<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br></div>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;mailto:<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<div class="Ih2E3d"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp; &nbsp; &nbsp;rules-users mailing list<br></div>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a> &lt;mailto:<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<div class="Ih2E3d">
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
<br>
 &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp;rules-users mailing list<br></div>
 &nbsp; &nbsp;<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a> &lt;mailto:<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>&gt;<div class="Ih2E3d">
<br>
 &nbsp; &nbsp;<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
------------------------------------------------------------------------<br>
<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>
 &nbsp;<br>
</div></blockquote><div><div></div><div class="Wj3C7c">
<br>
<br>
-- <br>
This message has been scanned for viruses and<br>
dangerous content by WATEEN TELECOM, and is<br>
believed to be clean.<br>
<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>
</div></div></blockquote></div><br></div>