Hi at all
My problem to solve is the following. I have employees and jobs. A job is of a specific profile (Dev, Manager, etc). Same for the employees. An employee can applicate on jobs. On every job application the employee can give a priority. Same on the job side.
These are the constraints:
Hard 1: An employee can only be assigned to one job
Hard 2: A job can only be assigned to one employee
Hard 3: The profile of the employee must match the profile of the job
Soft 1: The job with the highest priority is assigned (highest priority = 2*prio_emp + prio_job)
I'm struggling now on the hard constraint 3
// An employee and a job must have the same profile
private fun profileConstraint(constraintFactory: ConstraintFactory): Constraint {
return constraintFactory.from(Employee::class.java)
.join(Job::class.java, Joiners.equal(Employee::profile, Job::profile))
.penalize("profile constraint", HardSoftScore.ONE_HARD)
}
I also tried with filter.
In the solution are employees with the wrong job profile.
What is wrong on this constraint?
Thanks for your help.
Carlo