Search in sources :

Example 1 with ReactiveFromNodeLeftTuple

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

the class ReactiveObjectUtil method notifyModification.

public static void notifyModification(Object object, Collection<Tuple> leftTuples, ModificationType type) {
    for (Tuple leftTuple : leftTuples) {
        if (!((ReactiveFromNodeLeftTuple) leftTuple).updateModificationState(object, type)) {
            continue;
        }
        PropagationContext propagationContext = leftTuple.getPropagationContext();
        ReactiveFromNode node = leftTuple.getTupleSink();
        LeftTupleSinkNode sink = node.getSinkPropagator().getFirstLeftTupleSink();
        ReteEvaluator reteEvaluator = propagationContext.getFactHandle().getReteEvaluator();
        reteEvaluator.addPropagation(new ReactivePropagation(object, (ReactiveFromNodeLeftTuple) leftTuple, propagationContext, node, sink, type));
    }
}
Also used : ReteEvaluator(org.drools.core.common.ReteEvaluator) PropagationContext(org.drools.core.spi.PropagationContext) ReactiveFromNode(org.drools.core.reteoo.ReactiveFromNode) LeftTupleSinkNode(org.drools.core.reteoo.LeftTupleSinkNode) ReactiveFromNodeLeftTuple(org.drools.core.reteoo.ReactiveFromNodeLeftTuple) LeftTuple(org.drools.core.reteoo.LeftTuple) PhreakFromNode.deleteChildLeftTuple(org.drools.core.phreak.PhreakFromNode.deleteChildLeftTuple) Tuple(org.drools.core.spi.Tuple) ReactiveFromNodeLeftTuple(org.drools.core.reteoo.ReactiveFromNodeLeftTuple)

Aggregations

ReteEvaluator (org.drools.core.common.ReteEvaluator)1 PhreakFromNode.deleteChildLeftTuple (org.drools.core.phreak.PhreakFromNode.deleteChildLeftTuple)1 LeftTuple (org.drools.core.reteoo.LeftTuple)1 LeftTupleSinkNode (org.drools.core.reteoo.LeftTupleSinkNode)1 ReactiveFromNode (org.drools.core.reteoo.ReactiveFromNode)1 ReactiveFromNodeLeftTuple (org.drools.core.reteoo.ReactiveFromNodeLeftTuple)1 PropagationContext (org.drools.core.spi.PropagationContext)1 Tuple (org.drools.core.spi.Tuple)1