<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    The set of OSGi bundles dependencies can be used here:<br>
    <a class="moz-txt-link-freetext" href="http://www.jboss.org/drools/downloads.html">http://www.jboss.org/drools/downloads.html</a><br>
    <br>
    We test against spring:<br>
<a class="moz-txt-link-freetext" href="http://fisheye.jboss.org/browse/JBossRules/trunk/osgi-bundles/org.drools.osgi.test/src/test/java/org/drools/osgi/integrationtests/SimpleOsgiTest.java">http://fisheye.jboss.org/browse/JBossRules/trunk/osgi-bundles/org.drools.osgi.test/src/test/java/org/drools/osgi/integrationtests/SimpleOsgiTest.java</a><br>
    <br>
    This is our project that builds osgi-bundles and does some testing
    of Drools against OSGi:<br>
    <a class="moz-txt-link-freetext" href="http://fisheye.jboss.org/browse/JBossRules/trunk/osgi-bundles/">http://fisheye.jboss.org/browse/JBossRules/trunk/osgi-bundles/</a><br>
    <br>
    I have done some minimal OSGi docs. OSGI is stil la work in progress
    for us and we have only osgi-ified some aspects Drools, although we
    have done extensive work on the classloaders to make it fit better.<br>
<a class="moz-txt-link-freetext" href="https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-integration/html/ch05.html">https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-integration/html/ch05.html</a><br>
    <br>
    Please do test what we have, maybe help us OSGi-ify other aspects of
    drools.<br>
    <br>
    Mark<br>
    On 04/08/2010 10:25, David Conde wrote:
    <blockquote
      cite="mid:AANLkTim3mCqYo59FvCokQkqPnoPxkoY43fVeqSLhiaPx@mail.gmail.com"
      type="cite">Hi,
      <div><br>
      </div>
      <div>I'm trying to get drools-core and drools-compiler 5.1 running
        on spring dm-server. Does anyone have the minimal list of OSGi
        bundles as maven dependencies handy?</div>
      <div><br>
      </div>
      <div>Thanks,</div>
      <div>Dave&nbsp;<br>
        <br>
        <div class="gmail_quote">On 25 June 2010 13:59, mmarmol <span
            dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:marcelo.marmol@gmail.com">marcelo.marmol@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <br>
            Hi, I have managed to install Drools-core and
            Drools-compiler in my Equinox<br>
            osgi environment, I can compile rules and execute them just
            fine, I was just<br>
            wandering how to configure a KnowledgeAgent using<br>
            KnowledgeBuilderFactoryService and
            KnowledgeBaseFactoryService. I managed to<br>
            configure one but i am not able to reload rules when they
            change at runtime.<br>
            I have started ResourceChangeScannerService and<br>
            ResourceChangeNotifierService, changeset related to the
            rules file gets read<br>
            but no change gets implemented. An idea?<br>
            <br>
            <br>
            Here is the code:<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;ResourceFactory.getResourceChangeScannerService().start();<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;ResourceFactory.getResourceChangeNotifierService().start();<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ServiceReference serviceRef = bc<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.getServiceReference(ServiceRegistry.class.getName());<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ServiceRegistry registry = (ServiceRegistry)
            bc.getService(serviceRef);<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeBuilderFactoryService
            knowledgeBuilderFactoryService = registry<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.get(KnowledgeBuilderFactoryService.class);<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeBaseFactoryService
            knowledgeBaseFactoryService = registry<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.get(KnowledgeBaseFactoryService.class);<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResourceFactoryService resourceFactoryService
            = registry<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.get(ResourceFactoryService.class);<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeBuilderConfiguration kbConf =
            knowledgeBuilderFactoryService<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.newKnowledgeBuilderConfiguration(null, getClass()<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.getClassLoader());<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeBuilder kbuilder =
            knowledgeBuilderFactoryService<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.newKnowledgeBuilder(kbConf);<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResourceFactoryService resource =
            resourceFactoryService;<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;kbuilder.add(resource.newFileSystemResource(filePath),<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ResourceType.CHANGE_SET);<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (kbuilder.hasErrors()) {<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;System.out.println(kbuilder.getErrors());<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new
            RuntimeException(kbuilder.getErrors().toString());<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeBaseConfiguration kbaseConf =
            knowledgeBaseFactoryService<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.newKnowledgeBaseConfiguration(null, getClass()<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;.getClassLoader());<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeBase kbase =
            knowledgeBaseFactoryService<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.newKnowledgeBase(kbaseConf);<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KnowledgeAgentConfiguration aconf =<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;KnowledgeAgentFactory.newKnowledgeAgentConfiguration();<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;aconf.setProperty("drools.agent.scanDirectories", "true");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;aconf.setProperty("drools.agent.scanResources", "true");<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aconf.setProperty("drools.agent.newInstance",
            "false");<br>
            <br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;kagent =
            KnowledgeAgentFactory.newKnowledgeAgent(
            "CoreDroolsAgent",kbase,<br>
            aconf);<br>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp;kagent.applyChangeSet(resource.newFileSystemResource(filePath));<br>
            <br>
            Thanks in advance!<br>
            <br>
            Cheers<br>
            <font color="#888888">--<br>
              View this message in context: <a moz-do-not-send="true"
href="http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-OSGI-tp921989p921989.html"
                target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-OSGI-tp921989p921989.html</a><br>
              Sent from the Drools - User mailing list archive at
              Nabble.com.<br>
            </font>
            <div>
              <div class="h5">_______________________________________________<br>
                rules-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
                <a moz-do-not-send="true"
                  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>
        <br clear="all">
        <br>
        <br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>