On 19-09-13 09:56, SNELS Nick wrote:

Hi,

 

I have the following Drools rule in Optaplanner:

 

rule "oneShiftPerDay"

    when

        $leftAssignment : ShiftAssignment($leftId : id, $employee : employee, $shiftDate : shiftDate, employee != null)

        $rightAssignment : ShiftAssignment(employee == $employee, shiftDate == $shiftDate, id > $leftId)

    then

        scoreHolder.addHardConstraintMatch(kcontext, -1);

end

 

But when I run the solver I get the following error:

 

09:02:46.128 [main] ERROR o.d.c.k.b.impl.AbstractKieModule - Unable to build KieBaseModel:defaultKieBase

Error importing : 'be.comp.permanenties.domain.solver.EmployeeAssignmentTotal'

Error importing : 'be.comp.permanenties.domain.solver.EmployeeWorkSequence'

Rule Compilation error : [Rule name='oneShiftPerDay']

            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

            be/comp/permanenties/solver/Rule_oneShiftPerDay544009415.java (2:978) :

Take a look at line 2 of your drl file.

Only a type can be imported. be.comp.permanenties.domain.solver.EmployeeAssignmentTotal resolves to a package

Apparently it says something like
  "import be.comp.permanenties.domain.solver.EmployeeAssignmentTotal"
and then take a look at your java packages and classes
if that exists as a class (and is case sensitive correct).

 

How can I solve this error? Thanks.

 

Kind regards,

 

Nick

Out of curiosity, what kind of employee scheduling do you do at the OCMW?
That would make an interesting, understandable, tangible use case to blog about it :)

http://www.ocmwturnhout.be


Dit bericht is onderworpen aan de bepalingen van onze disclaimer



_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users