rule "Rule_Reward_For_Same_Equipment"
when
$constaint : ConstraintValidator(is_Rule_Reward_For_Same_Equipment());
$events : ArrayList() from collect (Event(interval!=null && binAvailablity!=null && isPinned ==false))
$event:Event()
$reward:Integer(intValue>=0) from $event.rewardForConsectiveEquipment($events)
then
$constaint.score_Rule_Reward_For_Same_Equipment(kcontext,scoreHolder,$reward/10);
// scoreHolder.addSoftConstraintMatch(kcontext, $reward/10);
end
This is the DRL (Drools Rule Language) that I currently have. Now, I need to translate the same logic into Java Stream API to retrieve all events from memory and perform operations such as event grouping.
can you help me to fetch the all events in the java stream api and do some grouping operation of score deduction