Search in sources :

Example 11 with PhreakPropagationContext

use of org.drools.core.common.PhreakPropagationContext in project drools by kiegroup.

the class RightBuilder method delete.

public RightBuilder delete(Object... objects) {
    for (Object object : objects) {
        InternalFactHandle fh = (InternalFactHandle) wm.insert(object);
        RightTuple rightTuple = fh.getFirstRightTuple();
        rightTuple.setPropagationContext(new PhreakPropagationContext());
        rightTuples.addDelete(rightTuple);
    }
    return this;
}
Also used : PhreakPropagationContext(org.drools.core.common.PhreakPropagationContext) InternalFactHandle(org.drools.core.common.InternalFactHandle) RightTuple(org.drools.core.reteoo.RightTuple)

Example 12 with PhreakPropagationContext

use of org.drools.core.common.PhreakPropagationContext in project drools by kiegroup.

the class RightBuilder method insert.

public RightBuilder insert(Object... objects) {
    for (Object object : objects) {
        InternalFactHandle fh = (InternalFactHandle) wm.insert(object);
        RightTuple rightTuple = new RightTupleImpl(fh, sink);
        rightTuple.setPropagationContext(new PhreakPropagationContext());
        rightTuples.addInsert(rightTuple);
    }
    return this;
}
Also used : PhreakPropagationContext(org.drools.core.common.PhreakPropagationContext) RightTupleImpl(org.drools.core.reteoo.RightTupleImpl) InternalFactHandle(org.drools.core.common.InternalFactHandle) RightTuple(org.drools.core.reteoo.RightTuple)

Example 13 with PhreakPropagationContext

use of org.drools.core.common.PhreakPropagationContext in project drools by kiegroup.

the class RightBuilder method update.

public RightBuilder update(Object... objects) {
    for (Object object : objects) {
        InternalFactHandle fh = (InternalFactHandle) wm.insert(object);
        RightTuple rightTuple = fh.getFirstRightTuple();
        rightTuple.setPropagationContext(new PhreakPropagationContext());
        rightTuples.addUpdate(rightTuple);
    }
    return this;
}
Also used : PhreakPropagationContext(org.drools.core.common.PhreakPropagationContext) InternalFactHandle(org.drools.core.common.InternalFactHandle) RightTuple(org.drools.core.reteoo.RightTuple)

Example 14 with PhreakPropagationContext

use of org.drools.core.common.PhreakPropagationContext in project drools by kiegroup.

the class LeftMemory method getLeftTuples.

public List<LeftTuple> getLeftTuples(Object... objects) {
    BetaNode node = scenario.getBetaNode();
    BetaMemory bm = scenario.getBm();
    TupleMemory ltm = bm.getLeftTupleMemory();
    InternalWorkingMemory wm = scenario.getWorkingMemory();
    if (objects == null) {
        objects = new Object[0];
    }
    List<LeftTuple> list = new ArrayList<LeftTuple>();
    for (Object object : objects) {
        InternalFactHandle fh = (InternalFactHandle) wm.insert(object);
        LeftTuple expectedLeftTuple = node.createLeftTuple(fh, true);
        expectedLeftTuple.setPropagationContext(new PhreakPropagationContext());
        list.add(expectedLeftTuple);
    }
    scenario.setTestLeftMemory(true);
    return list;
}
Also used : InternalWorkingMemory(org.drools.core.common.InternalWorkingMemory) PhreakPropagationContext(org.drools.core.common.PhreakPropagationContext) BetaNode(org.drools.core.reteoo.BetaNode) ArrayList(java.util.ArrayList) BetaMemory(org.drools.core.reteoo.BetaMemory) InternalFactHandle(org.drools.core.common.InternalFactHandle) LeftTuple(org.drools.core.reteoo.LeftTuple) TupleMemory(org.drools.core.reteoo.TupleMemory)

Example 15 with PhreakPropagationContext

use of org.drools.core.common.PhreakPropagationContext in project drools by kiegroup.

the class LeftBuilder method insert.

public LeftBuilder insert(Object... objects) {
    for (Object object : objects) {
        InternalFactHandle fh = (InternalFactHandle) wm.insert(object);
        LeftTuple leftTuple = sink.createLeftTuple(fh, true);
        leftTuple.setPropagationContext(new PhreakPropagationContext());
        leftTuples.addInsert(leftTuple);
    }
    return this;
}
Also used : PhreakPropagationContext(org.drools.core.common.PhreakPropagationContext) InternalFactHandle(org.drools.core.common.InternalFactHandle) LeftTuple(org.drools.core.reteoo.LeftTuple)

Aggregations

InternalFactHandle (org.drools.core.common.InternalFactHandle)17 PhreakPropagationContext (org.drools.core.common.PhreakPropagationContext)17 LeftTuple (org.drools.core.reteoo.LeftTuple)8 RightTuple (org.drools.core.reteoo.RightTuple)8 ArrayList (java.util.ArrayList)5 InternalWorkingMemory (org.drools.core.common.InternalWorkingMemory)4 BetaMemory (org.drools.core.reteoo.BetaMemory)4 BetaNode (org.drools.core.reteoo.BetaNode)4 RightTupleImpl (org.drools.core.reteoo.RightTupleImpl)4 TupleMemory (org.drools.core.reteoo.TupleMemory)4 Map (java.util.Map)1 QueryResultsImpl (org.drools.core.QueryResultsImpl)1 DroolsQuery (org.drools.core.base.DroolsQuery)1 NonCloningQueryViewListener (org.drools.core.base.NonCloningQueryViewListener)1 QueryRowWithSubruleIndex (org.drools.core.base.QueryRowWithSubruleIndex)1 PropagationEntry (org.drools.core.phreak.PropagationEntry)1 TerminalNode (org.drools.core.reteoo.TerminalNode)1 Declaration (org.drools.core.rule.Declaration)1 PropagationContext (org.drools.core.spi.PropagationContext)1