I found (i guess) a way to iterate over list, but it is not comparing and assigning the workorder now. I tried this way:
-----------------
rule "requiredSkill"
when
There is an unassigned workorder
and the workorder has a requiredSkill other than null
and there is an engineer
and the engineer has a skill other than null
and engineer skill is the same as workorder skill
then
assign workorder to engineer
engineer
-----------------
this is how i tried implementing;
-----------------
rule "requiredSkill"
when
$workOrder : WorkOrder()
$woReqSkill : SkillWorkOrder($requiredSkillWO : skill , eval(skill != null)) from $workOrder.requiredSkills
$engineer : Engineer()
$engineerSkill : SkillEngineer($engSkill : skill, eval(skill != null)) from $engineer.skillEngineerList
exists SkillEngineer( $engineerSkill.skill == $woReqSkill.skill )
then
insertLogical(new IntConstraintOccurrence("requiredSkill", ConstraintType.NEGATIVE_HARD,
1, $engineer));
end
-----------------
But all workorders are going to the same one, it is not validating if one is equals to other.