<div dir="ltr">Hello!<div style>I'm still not getting good with drools rules, i'm trying several examples and basic ones. Some i did without any problem and understood plenty well, but when I try to make an approach to what i'm aiming, I'm not able to.</div>
<div style><br></div><div style>Right now I'm trying to compose this:</div><div style><br></div><div style>When</div><div style> there's an workorder with skill</div><div style> and there's and engineer with the skill and capable of doing that workorder</div>
<div style>then</div><div style> the engineer should do it</div><div style><br></div><div style>So i tried something like this:</div><div style><br></div><div style><div>rule "assignSkillWOToSkilledEngineer"</div>
<div><span class="" style="white-space:pre">        </span>when</div><div><span class="" style="white-space:pre">                </span>$wo : WorkOrder( $requiredSkill : requiredSkill )</div><div><span class="" style="white-space:pre">                </span>$engineer : Engineer(skill == $requiredSkill)</div>
<div><span class="" style="white-space:pre">        </span>then</div><div><span class="" style="white-space:pre">                </span>insertLogical(new IntConstraintOccurrence("assignSkillWOToSkilledEngineer", ConstraintType.NEGATIVE_HARD,</div>
<div><span class="" style="white-space:pre">                                        </span>1, $engineer));</div><div>end</div><div><br></div><div style>i get no exceptions, but the sort is not working properly</div></div></div>