Package org.drools.common

Examples of org.drools.common.BetaConstraints


     * @return
     */
    public BetaConstraints createBetaNodeConstraint(final BuildContext context,
                                                    final List list,
                                                    final boolean disableIndexing ) {
        BetaConstraints constraints;
        switch ( list.size() ) {
            case 0 :
                constraints = EmptyBetaConstraints.getInstance();
                break;
            case 1 :
View Full Code Here


            if ( !context.isTupleMemoryEnabled() && existSubNetwort ) {
                // If there is a RIANode, so need to handle. This only happens with queries, so need to worry about sharing
                context.setTupleSource( (LeftTupleSource) utils.attachNode( context, new QueryRiaFixerNode( context.getNextId(), context.getTupleSource(), context ) ) );  
            }            

            final BetaConstraints betaConstraints = utils.createBetaNodeConstraint( context,
                                                                                    context.getBetaconstraints(),
                                                                                    false );

            // then attach the EXISTS node. It will work both as a simple exists node
            // or as subnetwork join node as the context was set appropriatelly
View Full Code Here

                      final BuildUtils utils,
                      final RuleConditionElement rce) {
        final From from = (From) rce;
        context.pushRuleComponent( from );

        @SuppressWarnings("unchecked")
        BetaConstraints betaConstraints = utils.createBetaNodeConstraint( context, (List<BetaNodeFieldConstraint>) context.getBetaconstraints(), true );
       
        context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                new FromNode( context.getNextId(),
                                                                              from.getDataProvider(),
View Full Code Here

                }

                // if there was a previous tuple source, then a join node is needed
                if (context.getObjectSource() != null && context.getTupleSource() != null) {
                    // so, create the tuple source and clean up the constraints and object source
                    final BetaConstraints betaConstraints = utils.createBetaNodeConstraint( context,
                                                                                            context.getBetaconstraints(),
                                                                                            false );

                    context.setTupleSource((LeftTupleSource) utils.attachNode(context,
                                                                              new JoinNode(context.getNextId(),
View Full Code Here

            if ( !context.isTupleMemoryEnabled() && existSubNetwort ) {
                // If there is a RIANode, so need to handle. This only happens with queries, so need to worry about sharing
                context.setTupleSource( (LeftTupleSource) utils.attachNode( context, new QueryRiaFixerNode( context.getNextId(), context.getTupleSource(), context ) ) );  
            }             

            final BetaConstraints betaConstraints = utils.createBetaNodeConstraint( context,
                                                                                    context.getBetaconstraints(),
                                                                                    false );
            // then attach the NOT node. It will work both as a simple not node
            // or as subnetwork join node as the context was set appropriatelly
            // in each case
View Full Code Here

                                                                              declaration,
                                                                              ValueType.PINTEGER_TYPE.getEvaluator( Operator.EQUAL ) );
        final RuleBaseConfiguration configuration = new RuleBaseConfiguration();
        configuration.setIndexRightBetaMemory( false );
        configuration.setIndexLeftBetaMemory( false );
        final BetaConstraints betaConstraints = new SingleBetaConstraints( variableConstraint,
                                                                           configuration );

        final List list = new ArrayList();
        final Cheese cheese1 = new Cheese( "cheddar",
                                           18 );
View Full Code Here

            Assert.fail( "No exception should be raised in this procedure, but got: " + e.toString() );
        }
    }

    public void testGetConstraints_ReturnsNullEvenWithEmptyBinder() {
        final BetaConstraints nullConstraints = EmptyBetaConstraints.getInstance();
       
        ReteooRuleBase ruleBase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase();
        BuildContext buildContext = new BuildContext( ruleBase, ruleBase.getReteooBuilder().getIdGenerator() );
       
        final NotNode notNode = new NotNode( 1,
View Full Code Here

     * @return
     */
    public BetaConstraints createBetaNodeConstraint(final BuildContext context,
                                                    final List<BetaNodeFieldConstraint> list,
                                                    final boolean disableIndexing) {
        BetaConstraints constraints;
        switch ( list.size() ) {
            case 0 :
                constraints = EmptyBetaConstraints.getInstance();
                break;
            case 1 :
View Full Code Here

            betaConstraints.add( constraint );
            context.setBetaconstraints( betaConstraints );
            existSubNetwort = true;
        }

        BetaConstraints binder = utils.createBetaNodeConstraint( context,
                                                                 context.getBetaconstraints(),
                                                                 false );
        // indexing for the results should be always disabled
        BetaConstraints resultBinder = utils.createBetaNodeConstraint( context,
                                                                       resultBetaConstraints,
                                                                       true );

        Behavior[] behaviors = Behavior.EMPTY_BEHAVIOR_LIST;
        if ( !context.getBehaviors().isEmpty() ) {
View Full Code Here

            betaConstraints.add( constraint );
            context.setBetaconstraints( betaConstraints );
            existSubNetwort = true;
        }
       
        final BetaConstraints resultsBinder = utils.createBetaNodeConstraint( context,
                                                                              resultBetaConstraints,
                                                                              true );
        final BetaConstraints sourceBinder = utils.createBetaNodeConstraint( context,
                                                                             context.getBetaconstraints(),
                                                                             false );
       
        Behavior[] behaviors = Behavior.EMPTY_BEHAVIOR_LIST;
        if( ! context.getBehaviors().isEmpty() ) {
View Full Code Here

TOP

Related Classes of org.drools.common.BetaConstraints

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.