0

我在 Optaplanner 中有以下 Drools 规则:

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

但是当我运行求解器时,出现以下错误:

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) : Only a type can be imported. be.comp.permanenties.domain.solver.EmployeeAssignmentTotal resolves to a package

我该如何解决这个错误?谢谢。

亲切的问候,

缺口

4

1 回答 1

-1

这是一个错误命名的导入,因此无法找到导入的包。

于 2013-10-16T07:47:42.267 回答