<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I get it to work. Four steps where
needed:<br>
1. Adding <br>
<br>
private KnowledgeBase <b>kBase</b>;//injected with Spring<br>
....<br>
// Build the Solver<br>
SolverFactory solverFactory = new
XmlSolverFactory("/planner/solverConfig.xml");<br>
RuleBase ruleBase = ((InternalKnowledgeBase) <b>kBase</b>).getRuleBase();<br>
solverFactory.getSolverConfig().getScoreDirectorFactoryConfig().setRuleBase(ruleBase);<br>
<br>
to my code to link Guvnor and solverFactory.<br>
<br>
And spring integration with Drools:<br>
<br>
<drools:kbase id="knowledgeBase"/><br>
<drools:kagent kbase="knowledgeBase" id="kagent"
new-instance="false"> <br>
<drools:resources> <br>
<drools:resource type="PKG" <br>
source="${drools.url}"<br>
basic-authentication="enabled" <br>
username="admin" <br>
password="admin"/> <br>
</drools:resources> <br>
</drools:kagent><br>
<br>
<bean id="planner" class="..."><br>
<property name="<b>kBase</b>" ref="knowledgeBase"/><br>
</bean><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>
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>
</body>
</html>