bms[i - 1] = (BetaMemory) nodeMem2;
}
}
}
RiaNodeMemory rnm = (RiaNodeMemory) wm.getNodeMemory( riaNode );
length--; // subtract one, as first is not in the array;
for (LeftTuple leftTuple = srcTuples.getInsertFirst(); leftTuple != null; ) {
LeftTuple next = leftTuple.getStagedNext();
PropagationContext pctx = leftTuple.getPropagationContext();
InternalFactHandle handle = riaNode.createFactHandle(leftTuple, pctx, wm);
// this is required for serialization support
rnm.getMap().put( leftTuple, handle );
RightTuple rightTuple = new RightTuple(handle, betaNode);
leftTuple.setObject(rightTuple);
rightTuple.setPropagationContext(pctx);
bm.getStagedRightTuples().addInsert(rightTuple);
if (bns != null) {
// Add peered RightTuples, they are attached to FH - unlink LeftTuples that has a peer ref
for (int i = 0; i < length; i++) {
rightTuple = new RightTuple(handle, bns[i]);
rightTuple.setPropagationContext(pctx);
bms[i].getStagedRightTuples().addInsert(rightTuple);
}
}
leftTuple.clearStaged();
leftTuple = next;
}
for (LeftTuple leftTuple = srcTuples.getDeleteFirst(); leftTuple != null; ) {
LeftTuple next = leftTuple.getStagedNext();
// this is required for serialization support
rnm.getMap().remove( leftTuple );
RightTuple rightTuple = (RightTuple) leftTuple.getObject();
RightTupleSets rightTuples = bm.getStagedRightTuples();
switch (rightTuple.getStagedType()) {
case LeftTuple.INSERT: {