BetaMemory bm = fm.getBetaMemory();
ContextEntry[] context = bm.getContext();
BetaConstraints betaConstraints = fromNode.getBetaConstraints();
AlphaNodeFieldConstraint[] alphaConstraints = fromNode.getAlphaConstraints();
DataProvider dataProvider = fromNode.getDataProvider();
Class resultClass = fromNode.getResultClass();
for ( LeftTuple leftTuple = srcLeftTuples.getInsertFirst(); leftTuple != null; ) {
LeftTuple next = leftTuple.getStagedNext();
PropagationContext propagationContext = leftTuple.getPropagationContext();
Map<Object, RightTuple> matches = null;
boolean useLeftMemory = true;
if ( !tupleMemoryEnabled ) {
// This is a hack, to not add closed DroolsQuery objects
Object object = leftTuple.get( 0 ).getObject();
if ( !(object instanceof DroolsQuery) || !((DroolsQuery) object).isOpen() ) {
useLeftMemory = false;
}
}
if ( useLeftMemory ) {
fm.betaMemory.getLeftTupleMemory().add( leftTuple );
matches = new LinkedHashMap<Object, RightTuple>();
leftTuple.setObject( matches );
}
betaConstraints.updateFromTuple( context,
wm,
leftTuple );
for ( final java.util.Iterator< ? > it = dataProvider.getResults( leftTuple,
wm,
propagationContext,
fm.providerContext ); it.hasNext(); ) {
final Object object = it.next();
if ( !resultClass.isAssignableFrom( object.getClass() ) ) {