queueRuleAgendaItem(wm);
}
public void queueRuleAgendaItem(InternalWorkingMemory wm) {
InternalAgenda agenda = (InternalAgenda) wm.getAgenda();
synchronized ( agendaItem ) {
agendaItem.getRuleExecutor().setDirty(true);
ActivationsFilter activationFilter = agenda.getActivationsFilter();
if ( activationFilter != null && !activationFilter.accept( agendaItem,
wm,
agendaItem.getTerminalNode() ) ) {
return;
}
if (!agendaItem.isQueued() && !agendaItem.isBlocked()) {
if ( log.isTraceEnabled() ) {
log.trace("Queue RuleAgendaItem {}", agendaItem);
}
InternalAgendaGroup ag = agendaItem.getAgendaGroup();
ag.add( agendaItem );
}
}
if ( agendaItem.getRule().isEager() ) {
// will return if already added
((InternalAgenda)wm.getAgenda()).addEagerRuleAgendaItem( agendaItem );
}
agenda.notifyHalt();
}