1

Drools Planner used this to select two distinct objects, ensuring that a rule did not fire twice for a given pair of objects. If o1 and o2 made a match, it fired only once, not twice for (o1,o2) and (o2,01).

when
    $stp1  : SubjectTeacherPeriod(  $slno : slNo,
                    $id : id,
                    $period_day_order : period.dayOrder
                    )
    $stp2  : SubjectTeacherPeriod(  slNo > $slno,
                    id == $id,
                    period.dayOrder == $period_day_order
                    )

How do I select a set of three distinct objects? What is a good selection criteria for that?

Jesvin Jose
  • 22,498
  • 32
  • 109
  • 202

1 Answers1

2

Same approach should work:

$f1 : SomeFact( ... )
$f2 : SomeFact( id > $f1.id, ... )
$f3 : SomeFact( id > $f2.id, ... )
Edson Tirelli
  • 3,891
  • 20
  • 23