Package org.drools.core.common

Examples of org.drools.core.common.EmptyBetaConstraints


                .setRightType( B.class )
                .setConstraint( "object", "!=", "$object" ).build();

        sinkNode = new JoinNode();
        sinkNode.setId( 1 );
        sinkNode.setConstraints( new EmptyBetaConstraints() );
       
        joinNode.addTupleSink( sinkNode );

        wm = (InternalWorkingMemory) buildContext.getRuleBase().newStatefulSession( true );
       
View Full Code Here


                .setRightType( B.class )
                .setConstraint( "object", "!=", "$object" ).build();

        sinkNode = new JoinNode();
        sinkNode.setId( 1 );
        sinkNode.setConstraints( new EmptyBetaConstraints() );
       
        joinNode.addTupleSink( sinkNode );

        wm = ((StatefulKnowledgeSessionImpl)buildContext.getKnowledgeBase().newStatefulKnowledgeSession());
       
View Full Code Here

                .setRightType( B.class )
                .setConstraint( "object", "!=", "$object" ).build();

        sinkNode0 = new JoinNode();
        sinkNode0.setId( 1 );
        sinkNode0.setConstraints( new EmptyBetaConstraints() );       
        joinNode.addTupleSink( sinkNode0 );
       
        sinkNode1 = new JoinNode();
        sinkNode1.setId( 2 );
        sinkNode1.setConstraints( new EmptyBetaConstraints() );       
        joinNode.addTupleSink( sinkNode1 );  
       
        sinkNode2 = new JoinNode();
        sinkNode2.setId( 3 );
        sinkNode2.setConstraints( new EmptyBetaConstraints() );       
        joinNode.addTupleSink( sinkNode2 );

        wm = ((StatefulKnowledgeSessionImpl)buildContext.getKnowledgeBase().newStatefulKnowledgeSession());
       
        bm =(BetaMemorywm.getNodeMemory( joinNode );
View Full Code Here

                                                                                                        constraintOperator), buildContext.getKnowledgeBase().getConfiguration());
            } catch (IntrospectionException e) {
                throw new RuntimeException(e);
            }
        } else {
            betaConstraints = new EmptyBetaConstraints();
        }

        switch (nodeType) {
            case NodeTypeEnums.JoinNode:
                return new JoinNode(0, leftInput, rightInput, betaConstraints, buildContext);
View Full Code Here

                .setRightType( B.class )
                .setConstraint( "object", "!=", "$object" ).build();

        sinkNode = new JoinNode();
        sinkNode.setId( 1 );
        sinkNode.setConstraints( new EmptyBetaConstraints() );
       
        joinNode.addTupleSink( sinkNode );

        wm = ((StatefulKnowledgeSessionImpl)buildContext.getKnowledgeBase().newStatefulKnowledgeSession());
View Full Code Here

                .setRightType( B.class )
                .setConstraint( "object", "!=", "$object" ).build();

        sinkNode0 = new JoinNode();
        sinkNode0.setId( 1 );
        sinkNode0.setConstraints( new EmptyBetaConstraints() );       
        joinNode.addTupleSink( sinkNode0 );
       
        sinkNode1 = new JoinNode();
        sinkNode1.setId( 2 );
        sinkNode1.setConstraints( new EmptyBetaConstraints() );       
        joinNode.addTupleSink( sinkNode1 );  
       
        sinkNode2 = new JoinNode();
        sinkNode2.setId( 3 );
        sinkNode2.setConstraints( new EmptyBetaConstraints() );       
        joinNode.addTupleSink( sinkNode2 );

        wm = ((StatefulKnowledgeSessionImpl)buildContext.getKnowledgeBase().newStatefulKnowledgeSession());
       
        bm =(BetaMemorywm.getNodeMemory( joinNode );
View Full Code Here

                                             .setRightType( B.class )
                                             .setConstraint( "object", operator, "$object" ).build();

        sinkNode = new JoinNode();
        sinkNode.setId( 1 );
        sinkNode.setConstraints( new EmptyBetaConstraints() );
       
        notNode.addTupleSink( sinkNode );

        wm = ((StatefulKnowledgeSessionImpl)buildContext.getKnowledgeBase().newStatefulKnowledgeSession());
       
View Full Code Here

            }
           
            BetaConstraints constraints;
            switch ( list.size() ) {
                case 0:
                    constraints = new EmptyBetaConstraints();
                    break;
                case 1:
                  constraints = new SingleBetaConstraints( list.get(0),
                                                           buildContext.getKnowledgeBase().getConfiguration() );
                  break;
View Full Code Here

            }
           
            BetaConstraints betaSourceConstraints;
            switch ( list.size() ) {
                case 0:
                    betaSourceConstraints = new EmptyBetaConstraints();
                    break;
                case 1:
                    betaSourceConstraints = new SingleBetaConstraints( list.get(0),
                                                           buildContext.getKnowledgeBase().getConfiguration() );
                  break;
                case 2:
                    betaSourceConstraints = new DoubleBetaConstraints( list.toArray( new BetaNodeFieldConstraint[2] ),
                                                             buildContext.getKnowledgeBase().getConfiguration() );
                    break;                   
                case 3:
                    betaSourceConstraints = new TripleBetaConstraints( list.toArray( new BetaNodeFieldConstraint[2] ),
                                                             buildContext.getKnowledgeBase().getConfiguration() );
                    break;                   
                case 4:
                    betaSourceConstraints = new QuadroupleBetaConstraints( list.toArray( new BetaNodeFieldConstraint[2] ),
                                                                 buildContext.getKnowledgeBase().getConfiguration() );
                    break;                                       
                default:
                    betaSourceConstraints = new DefaultBetaConstraints( list.toArray( new BetaNodeFieldConstraint[2] ),
                                                              buildContext.getKnowledgeBase().getConfiguration() );
                    break;                                       
                       
            }           

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) buildContext.getKnowledgeBase().getPackage( buildContext.getRule().getPackageName() ).getDialectRuntimeRegistry().getDialectData( "mvel" );
            data.onAdd( null, buildContext.getKnowledgeBase().getRootClassLoader() );
            //MvelD data = (MVELDialectRuntimeData) buildContext.getRuleBase().getPackage( buildContext.getRule().getName() ).getDialectRuntimeRegistry().getDialectData( "mvel" );
           
            NodeTestCase testCase = (NodeTestCase) context.get( "TestCase" );

            try {
                for ( String imp : testCase.getImports() ) {
                    if ( imp.endsWith( ".*" ) ) {
                        data.addPackageImport( imp.substring( 0,
                                                imp.lastIndexOf( '.' ) ) );
                    } else {
                        //classImports.add( imp );
                        cls = data.getRootClassLoader().loadClass( imp ) ;
                        data.addImport( cls.getSimpleName(),  cls);
                    }
                } 
            } catch (Exception e) {
                throw new RuntimeException("Unable to load class",e );
            }

            Declaration decl = (Declaration) context.get( expr );
            // build an external function executor
            MVELCompilationUnit compilationUnit = new MVELCompilationUnit( name,
                                                                           expr,
                                                                           new String[]{}, // global identifiers
                                                                           new EvaluatorWrapper[]{}, // operator identifiers
                                                                           new Declaration[]{}, // previous declarations
                                                                           new Declaration[]{decl}, // local declarations
                                                                           new String[]{}, // other identifiers
                                                                           new String[]{"this", "drools", "kcontext", "rule", decl.getIdentifier()}, // input identifiers
                                                                           new String[]{Object.class.getName(), KnowledgeHelper.class.getName(), KnowledgeHelper.class.getName(), Rule.class.getName(), decl.getValueType().getClassType().getName()}, // input types
                                                                           4,
                                                                           false,
                                                                           false );

            AccumulateFunction accFunction = new SumAccumulateFunction();

            Accumulator accumulator = new MVELAccumulatorFunctionExecutor( compilationUnit,
                                                                           accFunction );
            ((MVELCompileable) accumulator).compile( data );

            Accumulate accumulate = new SingleAccumulate( sourcePattern,
                                                          new Declaration[]{}, // required declaration
                                                          accumulator );
            AccumulateNode accNode = new AccumulateNode( buildContext.getNextId(),
                                                         leftTupleSource,
                                                         rightObjectSource,
                                                         alphaResultConstraint,
                                                         betaSourceConstraints,
                                                         new EmptyBetaConstraints(),
                                                         accumulate,
                                                         false,
                                                         buildContext );

            accNode.attach(buildContext);
View Full Code Here

            }
           
            BetaConstraints constraints;
            switch ( list.size() ) {
                case 0:
                    constraints = new EmptyBetaConstraints();
                    break;
                case 1:
                  constraints = new SingleBetaConstraints( list.get(0),
                                                           buildContext.getKnowledgeBase().getConfiguration() );
                  break;
View Full Code Here

TOP

Related Classes of org.drools.core.common.EmptyBetaConstraints

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.