}
public void retractLeftTuple(final LeftTuple leftTuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
final Activation activation = (Activation) leftTuple.getObject();
// activation can be null if the LeftTuple previous propagated into a no-loop
if ( activation == null ) {
return;
}
if ( activation.isActivated() ) {
// on fact expiration, we don't remove the activation, but let it fire
if ( context.getType() == PropagationContext.EXPIRATION && context.getFactHandleOrigin() != null ) {
EventFactHandle efh = (EventFactHandle) context.getFactHandleOrigin();
efh.increaseActivationsCount();
} else {
activation.remove();
if ( activation.getActivationGroupNode() != null ) {
activation.getActivationGroupNode().getActivationGroup().removeActivation( activation );
}
if ( activation.getActivationNode() != null ) {
final InternalRuleFlowGroup ruleFlowGroup = (InternalRuleFlowGroup) activation.getActivationNode().getParentContainer();
ruleFlowGroup.removeActivation( activation );
}
((EventSupport) workingMemory).getAgendaEventSupport().fireActivationCancelled( activation,
workingMemory,