<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 19-09-13 09:56, SNELS Nick wrote:<br>
</div>
<blockquote cite="mid:4E40FACF43E9614B8C999B2DCB96CD82CE3B35@jutter"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style>
<!--
@font-face
        {font-family:Calibri}
@font-face
        {font-family:"Trebuchet MS"}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.E-mailStijl17
        {font-family:"Trebuchet MS","sans-serif";
        color:windowtext}
.MsoChpDefault
        {}
@page WordSection1
        {margin:70.85pt 70.85pt 70.85pt 70.85pt}
div.WordSection1
        {}
-->
</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">Hi,</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">I
have the following Drools rule in Optaplanner:</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">rule
"oneShiftPerDay"</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
when</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
$leftAssignment : ShiftAssignment($leftId : id, $employee :
employee, $shiftDate : shiftDate, employee != null)</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
$rightAssignment : ShiftAssignment(employee == $employee,
shiftDate == $shiftDate, id > $leftId)</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
then</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
scoreHolder.addHardConstraintMatch(kcontext, -1);</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">end</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">But
when I run the solver I get the following error:</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">09:02:46.128
[main] ERROR o.d.c.k.b.impl.AbstractKieModule - Unable to
build KieBaseModel:defaultKieBase</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">Error
importing :
'be.comp.permanenties.domain.solver.EmployeeAssignmentTotal'</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">Error
importing :
'be.comp.permanenties.domain.solver.EmployeeWorkSequence'</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">Rule
Compilation error : [Rule name='oneShiftPerDay']</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
be/comp/permanenties/solver/Rule_oneShiftPerDay544009415.java
(2:220) : Only a type can be imported.
be.comp.permanenties.domain.solver.EmployeeWorkSequence
resolves to a package</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
be/comp/permanenties/solver/Rule_oneShiftPerDay544009415.java
(2:978) :</span></p>
</div>
</blockquote>
Take a look at line 2 of your drl file.
<blockquote cite="mid:4E40FACF43E9614B8C999B2DCB96CD82CE3B35@jutter"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">
Only a type can be imported.
be.comp.permanenties.domain.solver.EmployeeAssignmentTotal
resolves to a package</span></p>
</div>
</blockquote>
Apparently it says something like<br>
"import be.comp.permanenties.domain.solver.EmployeeAssignmentTotal"<br>
and then take a look at your java packages and classes<br>
if that exists as a class (and is case sensitive correct).<br>
<br>
<blockquote cite="mid:4E40FACF43E9614B8C999B2DCB96CD82CE3B35@jutter"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">How
can I solve this error? Thanks.
</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">Kind
regards,</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif""> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif"">Nick</span></p>
</div>
</blockquote>
Out of curiosity, what kind of employee scheduling do you do at the
OCMW?<br>
That would make an interesting, understandable, tangible use case to
blog about it :)<br>
<blockquote cite="mid:4E40FACF43E9614B8C999B2DCB96CD82CE3B35@jutter"
type="cite">
<div class="WordSection1">
</div>
<br>
<a moz-do-not-send="true" href="http://www.ocmwturnhout.be"><img
moz-do-not-send="true"
src="http://www.ocmwturnhout.be/_uploads/ocmw.turnhout.be/Afbeeldingen/werkenbijocmwturnhout.jpg"
alt="http://www.ocmwturnhout.be" height="107" width="480">
</a>
<p style="font-size:9px; font-family:'Trebuchet MS'"><br>
Dit bericht is onderworpen aan de bepalingen van onze <a
moz-do-not-send="true"
href="http://www.ocmwturnhout.be/nl/content/2436">
disclaimer</a> </p>
<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>