<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Thanks for the clear recipe!<br>
    <br>
    I've documented step 2 and 3 in the optaplanner manual (step 1 is
    already partially documented and the other part is documented in
    guvnor's docs).<br>
    <br>
    Step 4 sounds like a bug, so please raise an issue<br>
    if uploading the optaplanner-core jar as a POJO model jar, still
    causes a NoClassDefFoundError unless you put the jar in guvnor's
    WEB-INF/lib dir too:<br>
    &nbsp; <a class="moz-txt-link-freetext" href="https://issues.jboss.org/browse/GUVNOR">https://issues.jboss.org/browse/GUVNOR</a><br>
    <br>
    <div class="moz-cite-prefix">On 25-06-13 14:12, Bartek wrote:<br>
    </div>
    <blockquote cite="mid:51C98948.4060002@wp.pl" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">I get it to work. Four steps where
        needed:<br>
        1. Adding <br>
        <br>
        &nbsp;private KnowledgeBase <b>kBase</b>;//injected with Spring<br>
        ....<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Build the Solver<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SolverFactory solverFactory = new
        XmlSolverFactory("/planner/solverConfig.xml");<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RuleBase ruleBase = ((InternalKnowledgeBase) <b>kBase</b>).getRuleBase();<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
solverFactory.getSolverConfig().getScoreDirectorFactoryConfig().setRuleBase(ruleBase);<br>
        &nbsp;<br>
        to my code to link Guvnor and solverFactory.<br>
        &nbsp;<br>
        And spring integration with Drools:<br>
        <br>
        &nbsp;&nbsp; &lt;drools:kbase id="knowledgeBase"/&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;drools:kagent kbase="knowledgeBase" id="kagent"
        new-instance="false"&gt; <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;drools:resources&gt; <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;drools:resource type="PKG" <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;&nbsp;&nbsp;&nbsp;&nbsp; source="${drools.url}"<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;&nbsp;&nbsp;&nbsp;&nbsp; basic-authentication="enabled" <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;&nbsp;&nbsp;&nbsp;&nbsp; username="admin" <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;&nbsp;&nbsp;&nbsp;&nbsp; password="admin"/&gt; <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/drools:resources&gt; <br>
        &nbsp;&nbsp;&nbsp; &lt;/drools:kagent&gt;<br>
        <br>
        &nbsp;&lt;bean id="planner" class="..."&gt;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property name="<b>kBase</b>"
        ref="knowledgeBase"/&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
        <br>
        2. Importing drools-planner-core-5.5.0.Final.jar in Guvnor
        (Upload POJO Model jar)<br>
        3. Adding global in Guvnor:<br>
        &nbsp; global
        org.drools.planner.core.score.buildin.hardandsoft.HardAndSoftScoreHolder
        scoreHolder <br>
        4. Adding drools-planner-core-5.5.0.Final.jar to WEB-INF/lib in
        Guvnor instalation directory. Without that I still get
        NoClassDefFoundError while importing my domain in Guvnor.<br>
        <br>
        Best regards<br>
        <br>
        W dniu 2013-06-18 10:52, Geoffrey De Smet pisze:<br>
      </div>
      <blockquote cite="mid:51C01FD4.10400@gmail.com" type="cite">
        <meta content="text/html; charset=ISO-8859-1"
          http-equiv="Content-Type">
        <br>
        <blockquote cite="mid:51C0106F.2070100@wp.pl" type="cite">
          <div class="moz-cite-prefix"> <br>
            Is it generally good idea to try use guvnor to define
            scores? <br>
          </div>
        </blockquote>
        Yes, if you need that flexibility, as it allows you to change
        your score rules through the guvnor web interface.<br>
        However, this is mostly uncharted territory: some users have
        already successfully done it (there are mails on this mailing
        list's archive),<br>
        but there's little documentation and no example for it. Feel to
        do a write up once you get it to work, for the next person
        wanting to do this :)<br>
        <br>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>