I have based my code on the nurse rostering example. But I have completely
stripped out the GUI part.

But I have found the error. My rule was wrong. A rule that works for me is:

rule "alternativeSkill"
    when
        ShiftAssignment($employee : employee, $shiftType : shiftType)
        not SkillProficiency(employee == $employee, shiftType == $shiftType)
    then
        scoreHolder.addHardConstraintMatch(kcontext, -1);
end



--
View this message in context: 
http://drools.46999.n3.nabble.com/Optaplanner-rule-to-assign-employee-only-to-shift-when-he-she-has-the-skills-tp4026879p4026943.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to