tuple.increaseActivationCountForEvents();
fireActivation( item); // Control rules fire straight away.
return true;
}
final RuleImpl rule = rtn.getRule();
AgendaItem item;
final Timer timer = rule.getTimer();
InternalAgendaGroup agendaGroup = (InternalAgendaGroup) getAgendaGroup( rule.getAgendaGroup() );
if ( timer != null ) {
item = createScheduledAgendaItem( tuple,
context,
rtn,
agendaGroup
);
} else {
if ( rule.getCalendars() != null ) {
// for normal activations check for Calendar inclusion here, scheduled activations check on each trigger point
long timestamp = workingMemory.getSessionClock().getCurrentTime();
for ( String cal : rule.getCalendars() ) {
if ( !workingMemory.getCalendars().get( cal ).isTimeIncluded( timestamp ) ) {
return false;
}
}
}
if ( rule.isLockOnActive() && agendaGroup.isActive() && agendaGroup.getAutoFocusActivator() != context ) {
// do not add the activation if the rule is "lock-on-active" and the AgendaGroup is active
if ( tuple.getObject() == null ) {
tuple.setObject( Boolean.TRUE ); // this is so we can do a check with a bit more intent than a null check on modify
}
return false;
}
item = createAgendaItem( tuple,
0,
context,
rtn,
null,
agendaGroup
);
item.setSalience( rule.getSalience().getValue( new DefaultKnowledgeHelper( item, workingMemory ),
rule,
workingMemory ) );
}
if ( activationsFilter != null && !activationsFilter.accept( item,