//so need to preserve, so we can restore after this node is added. LeftMemory and Terminal remain the same once set.
boolean objectMemory = context.isObjectTypeNodeMemoryEnabled();
boolean alphaMemory = context.isAlphaMemoryAllowed();
ObjectType objectType = pattern.getObjectType();
if ( pattern.getObjectType() instanceof ClassObjectType ) {
// Is this the query node, if so we don't want any memory
if ( DroolsQuery.class == ((ClassObjectType) pattern.getObjectType()).getClassType() ) {
context.setTupleMemoryEnabled( false );
context.setObjectTypeNodeMemoryEnabled( false );
context.setAlphaNodeMemoryAllowed( false );
}
}
ObjectTypeNode otn = new ObjectTypeNode( context.getNextId(),
(EntryPointNode) context.getObjectSource(),
objectType,
context );
if ( objectType.isEvent() && EventProcessingOption.STREAM.equals( context.getRuleBase().getConfiguration().getEventProcessingMode() ) ) {
long expirationOffset = getExpiratioOffsetForType( context,
objectType );
if( expirationOffset != -1 ) {
// expiration policy is set, so use it
otn.setExpirationOffset( expirationOffset );