Package org.drools.spi

Examples of org.drools.spi.ObjectType


        this.ruleBase = ruleBase;
        this.entryPoint = entryPoint;
        this.typeDecl = ruleBase.getTypeDeclaration( clazz );
        final boolean isEvent = typeDecl != null && typeDecl.getRole() == TypeDeclaration.Role.EVENT;

        ObjectType objectType = ((AbstractRuleBase) ruleBase).getClassFieldAccessorCache().getClassObjectType( new ClassObjectType( clazz,
                                                                                                                                    isEvent ) );

        this.concreteObjectTypeNode = (ObjectTypeNode) ruleBase.getRete().getObjectTypeNodes( entryPoint ).get( objectType );
        if ( this.concreteObjectTypeNode == null ) {
            BuildContext context = new BuildContext( ruleBase,
View Full Code Here


    public FactTemplateTypeConf(final EntryPoint entryPoint,
                                final FactTemplate factTemplate,
                                final InternalRuleBase ruleBase) {
        this.factTemplate = factTemplate;

        ObjectType objectType = new FactTemplateObjectType( factTemplate );
        this.concreteObjectTypeNode = (ObjectTypeNode) ruleBase.getRete().getObjectTypeNodes( entryPoint ).get( objectType );
        if ( this.concreteObjectTypeNode == null ) {
            BuildContext context = new BuildContext( ruleBase,
                                                     ((ReteooRuleBase) ruleBase.getRete().getRuleBase()).getReteooBuilder().getIdGenerator() );
            if ( context.getRuleBase().getConfiguration().isSequential() ) {
View Full Code Here

            setDeclaredMask( Long.MAX_VALUE );
            return;
        }

        Pattern pattern = context.getLastBuiltPatterns()[0];
        ObjectType objectType = pattern.getObjectType();

        if ( !(objectType instanceof ClassObjectType) ) {
            // InitialFact has no type declaration and cannot be property specific
            // Only ClassObjectType can use property specific
            setDeclaredMask( Long.MAX_VALUE );
View Full Code Here

                           final InternalWorkingMemory workingMemory) {
        // @todo
        // JBRULES-612: the cache MUST be invalidated when a new node type is added to the network, so iterate and reset all caches.
        final ObjectTypeNode node = (ObjectTypeNode) sink;

        final ObjectType newObjectType = node.getObjectType();

        InternalWorkingMemoryEntryPoint wmEntryPoint = (InternalWorkingMemoryEntryPoint) workingMemory.getWorkingMemoryEntryPoint( this.entryPoint.getEntryPointId() );

        for ( ObjectTypeConf objectTypeConf : wmEntryPoint.getObjectTypeConfigurationRegistry().values() ) {
            if ( newObjectType.isAssignableFrom( objectTypeConf.getConcreteObjectTypeNode().getObjectType() ) ) {
                objectTypeConf.resetCache();
                ObjectTypeNode sourceNode = objectTypeConf.getConcreteObjectTypeNode();
                Iterator it = ((ObjectTypeNodeMemory) workingMemory.getNodeMemory( sourceNode )).memory.iterator();
                for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) {
                    sink.assertObject( (InternalFactHandle) entry.getValue(),
View Full Code Here

    }
   
    @Override
    protected void updateOTNs(TypeDeclaration type) {
        for( ObjectTypeNode otn : this.rete.getObjectTypeNodes() ) {
            ObjectType ot = otn.getObjectType();
            if( ot instanceof ClassObjectType ) {
                ClassObjectType cot = (ClassObjectType) ot;
                if( cot.getClassType().getName().equals( type.getTypeClassName() ) ) {
                    cot.setClassType( type.getTypeClass() );
                }
View Full Code Here

                                                          null,
                                                          "ObjectType not correctly defined" ) );
            return null;
        }

        ObjectType objectType = null;

        final FactTemplate factTemplate = context.getPkg().getFactTemplate( patternDescr.getObjectType() );

        if ( factTemplate != null ) {
            objectType = new FactTemplateObjectType( factTemplate );
View Full Code Here

    public FactTemplateTypeConf(final EntryPoint entryPoint,
                                final FactTemplate factTemplate,
                                final InternalRuleBase ruleBase) {
        this.factTemplate = factTemplate;
        this.entryPoint = entryPoint;
        ObjectType objectType = new FactTemplateObjectType( factTemplate );
        this.concreteObjectTypeNode = (ObjectTypeNode) ruleBase.getRete().getObjectTypeNodes( entryPoint ).get( objectType );
        if ( this.concreteObjectTypeNode == null ) {
            BuildContext context = new BuildContext( ruleBase,
                                                     ((ReteooRuleBase) ruleBase.getRete().getRuleBase()).getReteooBuilder().getIdGenerator() );
            if ( context.getRuleBase().getConfiguration().isSequential() ) {
View Full Code Here

            return;
        }

        if ( !(rightInput instanceof RightInputAdapterNode) ) {
            Pattern pattern = context.getLastBuiltPatterns()[0]; // right input pattern
            ObjectType objectType = pattern.getObjectType();

            if ( objectType instanceof ClassObjectType ) {
                Class objectClass = ((ClassObjectType) objectType).getClassType();
                if ( isPropertyReactive(context, objectClass) ) {
                    rightListenedProperties = pattern.getListenedProperties();
View Full Code Here

    }
   
    @Override
    protected void updateOTNs(TypeDeclaration type) {
        for( ObjectTypeNode otn : this.rete.getObjectTypeNodes() ) {
            ObjectType ot = otn.getObjectType();
            if( ot instanceof ClassObjectType ) {
                ClassObjectType cot = (ClassObjectType) ot;
                if( cot.getClassType().getName().equals( type.getTypeClassName() ) ) {
                    cot.setClassType( type.getTypeClass() );
                }
View Full Code Here

        this.ruleBase = ruleBase;
        this.entryPoint = entryPoint;
        this.typeDecl = ruleBase.getTypeDeclaration( clazz );
        final boolean isEvent = typeDecl != null && typeDecl.getRole() == TypeDeclaration.Role.EVENT;

        ObjectType objectType = ((AbstractRuleBase) ruleBase).getClassFieldAccessorCache().getClassObjectType( new ClassObjectType( clazz,
                                                                                                                                    isEvent ) );

        this.concreteObjectTypeNode = ruleBase.getRete().getObjectTypeNodes( entryPoint ).get( objectType );
        if ( this.concreteObjectTypeNode == null ) {
            BuildContext context = new BuildContext( ruleBase,
View Full Code Here

TOP

Related Classes of org.drools.spi.ObjectType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.