<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    in the manual, look for setRuleBase(), it's how you can set the DRL
    at runtime<br>
    <br>
    <div class="moz-cite-prefix">Op 22-01-13 20:17, Andr&eacute; Fr&oacute;es schreef:<br>
    </div>
    <blockquote
cite="mid:CAC8f_wXC+=AejatqvH1sDvfrWrtF_TRkRwJvTY-0B0f_3KTneg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Can it be done for the drl file pointed at xml
        file? Instead of pass the path to drl file, the drl content?
        <div><br>
        </div>
        <div>here's what i've done to use the xml by java over the
          cloudcomputing example:</div>
        <div><br>
        </div>
        <div>--------------------</div>
        <div><br>
        </div>
        <div>
          <div>
            <div>String t = "&lt;?xml version=\"1.0\"
encoding=\"UTF-8\"?&gt;&lt;solver&gt;&lt;solutionClass&gt;org.drools.planner.examples.cloudbalancing.domain.CloudBalance&lt;/solutionClass&gt;&lt;planningEntityClass&gt;org.drools.planner.examples.cloudbalancing.domain.CloudProcess&lt;/planningEntityClass&gt;&lt;scoreDirectorFactory&gt;&lt;scoreDefinitionType&gt;HARD_AND_SOFT&lt;/scoreDefinitionType&gt;&lt;scoreDrl&gt;/org/drools/planner/examples/cloudbalancing/solver/cloudBalancingScoreRules.drl&lt;/scoreDrl&gt;&lt;/scoreDirectorFactory&gt;&lt;termination&gt;&lt;maximumSecondsSpend&gt;120&lt;/maximumSecondsSpend&gt;&lt;/termination&gt;&lt;constructionHeuristic&gt;&lt;constructionHeuristicType&gt;FIRST_FIT_DECREASING&lt;/constructionHeuristicType&gt;&lt;constructionHeuristicPickEarlyType&gt;FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING&lt;/constructionHeuristicPickEarlyType&gt;&lt;/constructionHeuristic&gt;&lt;localSearch&gt;&lt;acceptor&gt;&lt;planningEntityTabuSize&gt;7&lt;/planningEntityTabuSize&gt;&lt;/acceptor&gt;&lt;forager&gt;&lt;mi
nimalAcceptedSelection&gt;1000&lt;/minimalAcceptedSelection&gt;&lt;/forager&gt;&lt;/localSearch&gt;&lt;/solver&gt;";</div>
            <div><br>
            </div>
            <div>&nbsp; &nbsp; <span class="" style="white-space:pre"> </span>byte
              b[] = t.getBytes();</div>
            <div>&nbsp; &nbsp; <span class="" style="white-space:pre"> </span>ByteArrayInputStream
              bt = new ByteArrayInputStream(b);</div>
            <div>
              &nbsp; &nbsp; &nbsp; &nbsp; SolverFactory solverFactory = new
              XmlSolverFactory().configure(bt);</div>
            <div>&nbsp; &nbsp; &nbsp; &nbsp; Solver solver = solverFactory.buildSolver();</div>
          </div>
        </div>
        <div>---------------------</div>
        <div><br>
        </div>
        <div style="">cloudBalancingScoreRules.drl is the file I want to
          get from database as text and apply it to the xml. Is it
          possible to do inside this configuration or will I have to
          implement a xml file pointing it everytime?</div>
        <div><br>
        </div>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">
            2013/1/22 Geoffrey De Smet <span dir="ltr">&lt;<a
                moz-do-not-send="true"
                href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>&gt;</span><br>
            <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">
              <div bgcolor="#FFFFFF" text="#000000"> Use a
                ByteArrayInputStream based on that String<br>
                and give it to:<br>
org.drools.planner.config.XmlSolverFactory#configure(InputStream)<br>
                <br>
                <div>Op 22-01-13 15:51, Andr&eacute; Fr&oacute;es schreef:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">Can I provide the plain xml code to a
                    SolverFactory?
                    <div><br>
                    </div>
                    <div>SolverFactory solverFactory = new
                      XmlSolverFactory(&lt;&lt;xmlHere&gt;&gt;);<br>
                    </div>
                    <div><br>
                    </div>
                    <div>I know that I can provide the path to a config
                      file.</div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                  <pre>_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<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>
</pre>
                </blockquote>
                <br>
              </div>
              <br>
              _______________________________________________<br>
              rules-users mailing list<br>
              <a moz-do-not-send="true"
                href="mailto:rules-users@lists.jboss.org"
                target="_blank">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>
              <br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <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>