public LinkedList<LogicalDependency<T>> getpreviousJustified() {
return previousJustified;
}
public void blockMatch(Match act) {
AgendaItem targetMatch = ( AgendaItem ) act;
// iterate to find previous equal logical insertion
LogicalDependency<SimpleMode> dep = null;
if ( this.previousBlocked != null ) {
for ( dep = (LogicalDependency<SimpleMode> ) this.previousBlocked.getFirst(); dep != null; dep = dep.getNext() ) {
if ( targetMatch == dep.getJustified() ) {
this.previousBlocked.remove( dep );
break;
}
}
}
if ( dep == null ) {
SimpleMode mode = new SimpleMode();
dep = new SimpleLogicalDependency( activation, targetMatch, mode );
mode.setObject( dep );
}
this.activation.addBlocked( dep );
if ( targetMatch.getBlockers().size() == 1 && targetMatch.isQueued() ) {
if ( targetMatch.getRuleAgendaItem() == null ) {
// it wasn't blocked before, but is now, so we must remove it from all groups, so it cannot be executed.
targetMatch.remove();
} else {
targetMatch.getRuleAgendaItem().getRuleExecutor().removeLeftTuple(targetMatch.getTuple());
}
if ( targetMatch.getActivationGroupNode() != null ) {
targetMatch.getActivationGroupNode().getActivationGroup().removeActivation( targetMatch );
}
if ( targetMatch.getActivationNode() != null ) {
final InternalRuleFlowGroup ruleFlowGroup = (InternalRuleFlowGroup) targetMatch.getActivationNode().getParentContainer();
ruleFlowGroup.remove( targetMatch );
}
}
}