[rules-users] Optaplanner rule to assign employee only to shift when he/she has the skills

ns nick.snels at ocmwturnhout.be
Thu Nov 21 10:23:16 EST 2013


I am trying to create a rule that adds a hard constraint when an employee
gets assigned to a shift for which he does not have the skills. 

I have created a table in MySQL that assigns an employee to a certain
shiftType. In my code I stated that once an employee is assigned to a
shiftType, he or she automatically has the skills needed for that shiftType,
hence the skill == $shiftType part in the rule.

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

With the above rule employees still get assigned to shifts they do not have
the skill for. What is wrong with this rule? Thanks.

Kind regards,

Nick



--
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-tp4026879.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list