}
}
private void attachObjectTypeNode( final BuildContext context, final BuildUtils utils, final Pattern pattern ) {
boolean objectMemory = context.isObjectTypeNodeMemoryEnabled();
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 = context.getComponentFactory().getNodeFactoryService().buildObjectTypeNode( 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 );