this.workingMemory.prepareToFireActivation();
tryagain = false;
final InternalAgendaGroup group = getNextFocus();
// if there is a group with focus
if ( group != null ) {
RuleAgendaItem item;
if ( workingMemory.getKnowledgeBase().getConfiguration().isSequential() ) {
item = (RuleAgendaItem) group.remove();
item.setBlocked(true);
} else {
item = (RuleAgendaItem) group.peek();
}
if (item != null) {
if (streamMode) {
garbageCollector.remove(item);
}
evaluateQueriesForRule(item);
localFireCount = item.getRuleExecutor().evaluateNetworkAndFire(this.workingMemory, filter,
fireCount, fireLimit);
if ( localFireCount == 0 ) {
// nothing matched
tryagain = true; // will force the next Activation of the agenda, without going to outer loop which checks halt
this.workingMemory.executeQueuedActions(); // There may actions to process, which create new rule matches