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

Geoffrey De Smet ge0ffrey.spam at gmail.com
Thu Nov 21 13:43:51 EST 2013


That seems wierd:

  skill == $shiftType

That's equals between apples and oranges?

On 21-11-13 16:23, ns wrote:
> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



More information about the rules-users mailing list