<div dir="ltr">Hello there. I've been trying to create a rule to plan the my workorders with higher priority first, but I'm not bein able to.<div><br></div><div style>I tried creating a rule something like "conflictingLecturesInSamePeriod", but I'm getting lost.</div>
<div style><br></div><div style>Example: I've implemented my previous example of engineer/workorders and added shitf and priority. The priorities goes from 1 to 5, the lowest it is, the more urgent it is (1-Highest, 2-High, etc..)</div>
<div style><br></div><div style>I don't know how to compare it to the other in the list, so I tried checking with previous ID, but no success:</div><div style>******************************</div><div style><div>rule "workOrderByPriority"</div>
<div><span class="" style="white-space:pre">        </span>when</div><div><span class="" style="white-space:pre">                </span>$leftWorkOrderPriority : WorkOrder($leftWOP : id, $leftPriority : priority.priorityID)</div><div><span class="" style="white-space:pre">                </span>$righttWorkOrderPriority : WorkOrder(id >= $leftWOP, $rightPriority : priority.priorityID)</div>
<div><span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">                </span>$engineer: Engineer($id : id)<span class="" style="white-space:pre">                </span></div><div><span class="" style="white-space:pre">        </span>then</div>
<div><span class="" style="white-space:pre">                </span>insertLogical(new IntConstraintOccurrence("workOrderByPriority", ConstraintType.NEGATIVE_SOFT, </div><div><span class="" style="white-space:pre">                                </span>1,</div>
<div><span class="" style="white-space:pre">                                <UNKNOWN></span>, $engineer));</div><div>end</div><div>*******************************</div><div>this above is the second attempt, the <UNKNOWN> is because i'm lost about what to add and also if i should add something there.<br>
</div><div><br></div><div style>the first try just pass straight forward</div><div style>*******************************<br></div><div style><div>rule "workOrderByPriority"</div><div><span class="" style="white-space:pre">        </span>when</div>
<div><span class="" style="white-space:pre">                </span>$engineer : Engineer($worktime : worktime)</div><div><span class="" style="white-space:pre">                </span>$priority : WorkOrder($priorityId : priority.priorityID)</div><div>
<span class="" style="white-space:pre">        </span>then</div><div><span class="" style="white-space:pre">                </span>insertLogical(new IntConstraintOccurrence("workOrderByPriority", ConstraintType.NEGATIVE_SOFT, </div>
<div><span class="" style="white-space:pre">                                </span>2,</div><div><span class="" style="white-space:pre">                                </span>$priority, $engineer));</div><div>end</div></div><div style>*******************************<br></div><div style>
i know i'm far from get even closer. In order to define the planner according to priority I think I should compare it with entire list isn't? I noticed that in some rules, and entire list is pointed. <br></div><div style>
<br></div><div style>I searched the guide and example for some tips, but the best I found was the course that compared 2 courses that I believe that will be the same thing i'll have to do with priorities.</div></div></div>