Examples of ObjectTypeNode


Examples of org.drools.reteoo.ObjectTypeNode

        str += "LeftInputAdapterNode:\n";
        str += "    lian0, otn1;";

        NodeTestResult result = executeTest( str );

        ObjectTypeNode otn1 = (ObjectTypeNode) result.context.get( "otn1" );
        LeftInputAdapterNode lian0 = (LeftInputAdapterNode) result.context.get( "lian0" );
        assertNotNull( lian0 );

        assertSame( lian0,
                    otn1.getSinkPropagator().getSinks()[0] );
    }

Examples of org.drools.reteoo.ObjectTypeNode

       
        assertEquals( "r1", list.get(0) );
       
        // Check it was built with MVELReturnValueExpression constraint
        List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
        ObjectTypeNode node = null;
        for ( ObjectTypeNode n : nodes ) {
            if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
                node = n;
                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        assertTrue( (( VariableConstraint ) alphanode.getConstraint()).getFieldExtractor() instanceof ClassFieldReader );
        ReturnValueRestriction r = (ReturnValueRestriction) (( VariableConstraint ) alphanode.getConstraint()).getRestriction();
       
        assertTrue( r.getExpression() instanceof ReturnValueExpression );
        assertTrue( r.getExpression() instanceof MVELReturnValueExpression );        

Examples of org.drools.reteoo.ObjectTypeNode

       
        assertEquals( "r1", list.get(0) );
       
        // Check it was built with MVELReturnValueExpression constraint
        List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
        ObjectTypeNode node = null;
        for ( ObjectTypeNode n : nodes ) {
            if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
                node = n;
                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        assertTrue( (( VariableConstraint ) alphanode.getConstraint()).getFieldExtractor() instanceof MVELClassFieldReader );
        ReturnValueRestriction r = (ReturnValueRestriction) (( VariableConstraint ) alphanode.getConstraint()).getRestriction();
       
        assertTrue( r.getExpression() instanceof ReturnValueExpression );
        assertTrue( r.getExpression() instanceof MVELReturnValueExpression )

Examples of org.drools.reteoo.ObjectTypeNode

       
        assertEquals( "r1", list.get(0) );
       
        // Check it was built with MVELReturnValueExpression constraint
        List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
        ObjectTypeNode node = null;
        for ( ObjectTypeNode n : nodes ) {
            if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
                node = n;
                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        assertTrue( (( VariableConstraint ) alphanode.getConstraint()).getFieldExtractor() instanceof MVELClassFieldReader );
        ReturnValueRestriction r = (ReturnValueRestriction) (( VariableConstraint ) alphanode.getConstraint()).getRestriction();
       
        assertTrue( r.getExpression() instanceof ReturnValueExpression );
        assertTrue( r.getExpression() instanceof MVELReturnValueExpression )

Examples of org.drools.reteoo.ObjectTypeNode

       
        assertEquals( "r1", list.get(0) );
       
        // Check it was built with MVELReturnValueExpression constraint
        List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
        ObjectTypeNode node = null;
        for ( ObjectTypeNode n : nodes ) {
            if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
                node = n;
                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        assertTrue( (( VariableConstraint ) alphanode.getConstraint()).getFieldExtractor() instanceof MVELClassFieldReader );
        ReturnValueRestriction r = (ReturnValueRestriction) (( VariableConstraint ) alphanode.getConstraint()).getRestriction();
       
        assertTrue( r.getExpression() instanceof ReturnValueExpression );
        assertTrue( r.getExpression() instanceof MVELReturnValueExpression )

Examples of org.drools.reteoo.ObjectTypeNode

            name = c[0].trim();
            source = c[1].trim();
        } else {
            throw new IllegalArgumentException( "Cannot execute arguments " + args );
        }
        ObjectTypeNode otn = (ObjectTypeNode) context.get( source );

        LeftInputAdapterNode liaNode = new LeftInputAdapterNode( buildContext.getNextId(),
                                                                 otn,
                                                                 buildContext );
        liaNode.attach();

Examples of org.drools.reteoo.ObjectTypeNode

            name = c[0].trim();
            type = c[1].trim();
        } else {
            throw new IllegalArgumentException( "Cannot execute arguments " + args );
        }
        ObjectTypeNode otn;
        try {
            EntryPointNode epn = new EntryPointNode( buildContext.getNextId(),
                                                     buildContext.getRuleBase().getRete(),
                                                     buildContext );
            epn.attach();

            otn = new ObjectTypeNode( buildContext.getNextId(),
                                      epn,
                                      new ClassObjectType( Class.forName( type ) ),
                                      buildContext );
            // we don't attach, as we want to manually propagate and not
            // have the working memory propagate

Examples of org.drools.reteoo.ObjectTypeNode

        assertNotNull( defaultEntryPointNode );

        Map<ObjectType, ObjectTypeNode> obnodes = defaultEntryPointNode.getObjectTypeNodes();

        ObjectType key = new ClassObjectType( DroolsQuery.class );
        ObjectTypeNode droolsQueryNode = obnodes.get( key );
        ObjectHashSet droolsQueryMemory = (ObjectHashSet) abstractWorkingMemory.getNodeMemory( droolsQueryNode );
        assertEquals( 0,
                      droolsQueryMemory.size() );

        Entry[] entries = droolsQueryMemory.getTable();

Examples of org.drools.reteoo.ObjectTypeNode

        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
       
        List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
        ObjectTypeNode node = null;
        for ( ObjectTypeNode n : nodes ) {
            if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
                node = n;
                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];
        PredicateConstraint c = ( PredicateConstraint ) alphanode.getConstraint();
        assertTrue( c.getPredicateExpression() instanceof PredicateExpression );
        assertTrue( c.getPredicateExpression() instanceof CompiledInvoker );
        assertTrue( !(c.getPredicateExpression() instanceof MVELPredicateExpression ) );
       

Examples of org.drools.reteoo.ObjectTypeNode

        KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
        kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
       
        List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
        ObjectTypeNode node = null;
        for ( ObjectTypeNode n : nodes ) {
            if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
                node = n;
                break;
            }
        }
       
        BetaNode betaanode = (BetaNode) node.getSinkPropagator().getSinks()[0];
        BetaNodeFieldConstraint[] constraint = ( BetaNodeFieldConstraint[] ) betaanode.getConstraints();
        PredicateConstraint c = ( PredicateConstraint ) constraint[0];
        assertTrue( c.getPredicateExpression() instanceof PredicateExpression );
        assertTrue( c.getPredicateExpression() instanceof CompiledInvoker );
        assertTrue( !(c.getPredicateExpression() instanceof MVELPredicateExpression ) );
TOP
Copyright © 2018 www.massapi.com. 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.