Reputation: 23098
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?
Upvotes: 1
Views: 339
Reputation: 3901
Same approach should work:
$f1 : SomeFact( ... )
$f2 : SomeFact( id > $f1.id, ... )
$f3 : SomeFact( id > $f2.id, ... )
Upvotes: 2