<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é Fró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 = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?><solver><solutionClass>org.drools.planner.examples.cloudbalancing.domain.CloudBalance</solutionClass><planningEntityClass>org.drools.planner.examples.cloudbalancing.domain.CloudProcess</planningEntityClass><scoreDirectorFactory><scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType><scoreDrl>/org/drools/planner/examples/cloudbalancing/solver/cloudBalancingScoreRules.drl</scoreDrl></scoreDirectorFactory><termination><maximumSecondsSpend>120</maximumSecondsSpend></termination><constructionHeuristic><constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType><constructionHeuristicPickEarlyType>FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING</constructionHeuristicPickEarlyType></constructionHeuristic><localSearch><acceptor><planningEntityTabuSize>7</planningEntityTabuSize></acceptor><forager><mi
nimalAcceptedSelection>1000</minimalAcceptedSelection></forager></localSearch></solver>";</div>
<div><br>
</div>
<div> <span class="" style="white-space:pre"> </span>byte
b[] = t.getBytes();</div>
<div> <span class="" style="white-space:pre"> </span>ByteArrayInputStream
bt = new ByteArrayInputStream(b);</div>
<div>
SolverFactory solverFactory = new
XmlSolverFactory().configure(bt);</div>
<div> 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"><<a
moz-do-not-send="true"
href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>></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é Fró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(<<xmlHere>>);<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>