Search in sources :

Example 1 with LeftTupleSinkPropagator

use of org.drools.core.reteoo.LeftTupleSinkPropagator in project drools by kiegroup.

the class SegmentUtilities method isNonTerminalTipNode.

public static boolean isNonTerminalTipNode(LeftTupleNode node, TerminalNode removingTN) {
    LeftTupleSinkPropagator sinkPropagator = node.getSinkPropagator();
    if (removingTN == null) {
        return sinkPropagator.size() > 1;
    }
    if (sinkPropagator.size() == 1) {
        return false;
    }
    // we know the sink size is creater than 1 and that there is a removingRule that needs to be ignored.
    int count = 0;
    for (LeftTupleSinkNode sink = sinkPropagator.getFirstLeftTupleSink(); sink != null; sink = sink.getNextLeftTupleSinkNode()) {
        if (sinkNotExclusivelyAssociatedWithTerminal(removingTN, sink)) {
            count++;
            if (count > 1) {
                // There is more than one sink that is not for the removing rule
                return true;
            }
        }
    }
    return false;
}
Also used : LeftTupleSinkNode(org.drools.core.reteoo.LeftTupleSinkNode) LeftTupleSinkPropagator(org.drools.core.reteoo.LeftTupleSinkPropagator) QueryNameConstraint(org.drools.core.rule.constraint.QueryNameConstraint)

Aggregations

LeftTupleSinkNode (org.drools.core.reteoo.LeftTupleSinkNode)1 LeftTupleSinkPropagator (org.drools.core.reteoo.LeftTupleSinkPropagator)1 QueryNameConstraint (org.drools.core.rule.constraint.QueryNameConstraint)1