Package org.drools.rule

Examples of org.drools.rule.Accumulate


                                                                       resultBetaConstraints,
                                                                       true );

        CollectAccumulator accumulator = new CollectAccumulator( collect,
                                                                 existSubNetwort );
        Accumulate accumulate = new Accumulate( sourcePattern,
                                                sourcePattern.getRequiredDeclarations(),
                                                new Accumulator[] { accumulator },
                                                false );
        context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                    new AccumulateNode( context.getNextId(),
View Full Code Here


     * @inheritDoc
     */
    public void build(final BuildContext context,
                      final BuildUtils utils,
                      final RuleConditionElement rce) {
        final Accumulate accumulate = (Accumulate) rce;
        boolean existSubNetwort = false;
        context.pushRuleComponent( accumulate );

        final List resultBetaConstraints = context.getBetaconstraints();
        final List resultAlphaConstraints = context.getAlphaConstraints();

        RuleConditionElement source = accumulate.getSource();
        if( source instanceof GroupElement ) {
            GroupElement ge = (GroupElement) source;
            if( ge.isAnd() && ge.getChildren().size() == 1 ) {
                source = (RuleConditionElement) ge.getChildren().get( 0 );
            }
View Full Code Here

                                                      sourceOuterDeclr,
                                                      boundIds,
                                                      readLocalsFromTuple );
            }

            final Accumulate accumulate = new Accumulate( source,
                                                          null,
                                                          accumulators,
                                                          accumDescr.isMultiFunction() );

            MVELDialectRuntimeData data = (MVELDialectRuntimeData) context.getPkg().getDialectRuntimeRegistry().getDialectData( "mvel" );
View Full Code Here

        final boolean readLocalsFromTuple = PackageBuilderUtil.isReadLocalsFromTuple( accumDescr, source );
       
        Map<String, Declaration> declsInScope = context.getDeclarationResolver().getDeclarations( context.getRule() );
        Map<String, Class< ? >> declCls = DeclarationScopeResolver.getDeclarationClasses( declsInScope );

        Accumulate accumulate;
        if ( accumDescr.isExternalFunction() ) {
            // if it uses 1+ external function, build methods for them
            accumulate = buildExternalFunctionCall( context,
                                                    accumDescr,
                                                    source,
View Full Code Here

                                                                      usedIdentifiers,
                                                                      previousDeclarations,
                                                                      readLocalsFromTuple );
        }

        return new Accumulate(source,
                requiredDecl.toArray(new Declaration[requiredDecl.size()]),
                accumulators,
                accumDescr.isMultiFunction());
    }
View Full Code Here

        }

        map.put( "hashCode",
                actionCode.hashCode());

        Accumulate accumulate = new Accumulate(source, declarations);

        generateTemplates("accumulateInnerClass",
                "accumulateInvoker",
                context,
                className,
View Full Code Here

                                                                       resultBetaConstraints,
                                                                       true );

        CollectAccumulator accumulator = new CollectAccumulator( collect,
                                                                 existSubNetwort );
        Accumulate accumulate = new Accumulate( sourcePattern,
                                                sourcePattern.getRequiredDeclarations(),
                                                new Accumulator[] { accumulator },
                                                false );
        context.setTupleSource( (LeftTupleSource) utils.attachNode( context,
                                                                    new AccumulateNode( context.getNextId(),
View Full Code Here

     * @inheritDoc
     */
    public void build(final BuildContext context,
                      final BuildUtils utils,
                      final RuleConditionElement rce) {
        final Accumulate accumulate = (Accumulate) rce;
        boolean existSubNetwort = false;
        context.pushRuleComponent( accumulate );

        final List resultBetaConstraints = context.getBetaconstraints();
        final List resultAlphaConstraints = context.getAlphaConstraints();

        RuleConditionElement source = accumulate.getSource();
        if( source instanceof GroupElement ) {
            GroupElement ge = (GroupElement) source;
            if( ge.isAnd() && ge.getChildren().size() == 1 ) {
                source = (RuleConditionElement) ge.getChildren().get( 0 );
            }
View Full Code Here

        this.accumulator = new MockAccumulator();

        final ObjectType srcObjType = new ClassObjectType( String.class );
        final Pattern sourcePattern = new Pattern( 0,
                                                   srcObjType );
        this.accumulate = new Accumulate( sourcePattern,
                                          new Declaration[0],
                                          new Accumulator[] { this.accumulator },
                                          false );

        this.node = new AccumulateNode( 15,
View Full Code Here

        this.accumulator = new MockAccumulator();

        final ObjectType srcObjType = new ClassObjectType( String.class );
        final Pattern sourcePattern = new Pattern( 0,
                                                   srcObjType );
        this.accumulate = new Accumulate( sourcePattern,
                                          new Declaration[0],
                                          new Accumulator[] { this.accumulator },
                                          false );

        this.node = new AccumulateNode( 15,
View Full Code Here

TOP

Related Classes of org.drools.rule.Accumulate

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.