// AgendaGroup is active
// we must check the context to determine if its a new tuple or an
// exist re-activated tuple as part of the retract
if ( activation.getPropagationContext().getType() == PropagationContext.MODIFICATION ) {
if ( activation.getRule().isLockOnActive() && agendaGroup.isActive() ) {
Activation justifier = activation.getPropagationContext().removeRetractedTuple( activation.getRule(),
(LeftTuple) activation.getTuple() );
if ( justifier == null ) {
// This rule is locked and active, do not allow new
// tuples to activate
return false;
} else if ( activation.getRule().hasLogicalDependency() ) {
copyLogicalDependencies( activation.getPropagationContext(),
workingMemory,
activation,
justifier );
}
} else if ( activation.getRule().hasLogicalDependency() ) {
Activation justifier = activation.getPropagationContext().removeRetractedTuple( activation.getRule(),
(LeftTuple) activation.getTuple() );
copyLogicalDependencies( activation.getPropagationContext(),
workingMemory,
activation,
justifier );
}
} else if ( activation.getRule().isLockOnActive() && agendaGroup.isActive() ) {
return false;
}
agendaGroup.add( activation );
} else {
// There is a RuleFlowNode so add it there, instead of the Agenda
InternalRuleFlowGroup rfg = (InternalRuleFlowGroup) this.getRuleFlowGroup( activation.getRule().getRuleFlowGroup() );
// do not add the activation if the rule is "lock-on-active" and the
// RuleFlowGroup is active
// we must check the context to determine if its a new tuple or an
// exist re-activated tuple as part of the retract
if ( activation.getPropagationContext().getType() == PropagationContext.MODIFICATION ) {
if ( activation.getRule().isLockOnActive() && rfg.isActive() ) {
Activation justifier = activation.getPropagationContext().removeRetractedTuple( activation.getRule(),
(LeftTuple) activation.getTuple() );
if ( justifier == null ) {
// This rule is locked and active, do not allow new
// tuples to activate
return false;
} else if ( activation.getRule().hasLogicalDependency() ) {
copyLogicalDependencies( activation.getPropagationContext(),
workingMemory,
activation,
justifier );
}
} else if ( activation.getRule().hasLogicalDependency() ) {
Activation justifier = activation.getPropagationContext().removeRetractedTuple( activation.getRule(),
(LeftTuple) activation.getTuple() );
copyLogicalDependencies( activation.getPropagationContext(),
workingMemory,
activation,
justifier );