Package org.drools.core.time.impl

Examples of org.drools.core.time.impl.ExpressionIntervalTimer


                period = MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context );
            } else {
                period = MVELObjectExpressionBuilder.build( "0", context );
            }

            timer = new ExpressionIntervalTimer( createMVELExpr(startDate, context), createMVELExpr(endDate, context), repeatLimit, times, period );
        } else {
            DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
                                                  "Protocol for timer does not exist '" + timerString +"'" );
            context.addError( err );
            return;
View Full Code Here


            MVELObjectExpression times = MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context );
            MVELObjectExpression period = tok.hasMoreTokens() ?
                                          MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context ) :
                                          MVELObjectExpressionBuilder.build( "0", context );

            timer = new ExpressionIntervalTimer( createMVELExpr(startDate, context), createMVELExpr(endDate, context), repeatLimit, times, period );
        } else {
            DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
                                                  "Protocol for timer does not exist '" + timerString +"'" );
            context.addError( err );
            return;
View Full Code Here

                period = MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context );
            } else {
                period = MVELObjectExpressionBuilder.build( "0", context );
            }

            timer = new ExpressionIntervalTimer( startDate, endDate, repeatLimit, times, period );
        } else {
            DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
                                                  "Protocol for timer does not exist '" + timerString +"'" );
            context.addError( err );
            return;
View Full Code Here

            }
            Arrays.sort( this.enabledDeclarations, SortDeclarations.instance );             
        }       
       
        if ( rule.getTimer() instanceof ExpressionIntervalTimer ) {
            ExpressionIntervalTimer expr = ( ExpressionIntervalTimer ) rule.getTimer();
           
            Declaration[] declrs = expr.getDelayMVELCompilationUnit().getPreviousDeclarations();           
            this.timerDelayDeclarations = new Declaration[declrs.length];
            int i = 0;
            for ( Declaration declr : declrs ) {
                this.timerDelayDeclarations[i++] = decls.get( declr.getIdentifier() );
            }
            Arrays.sort( this.timerDelayDeclarations, SortDeclarations.instance );     
           
            declrs = expr.getPeriodMVELCompilationUnit().getPreviousDeclarations();           
            this.timerPeriodDeclarations = new Declaration[declrs.length];
            i = 0;
            for ( Declaration declr : declrs ) {
                this.timerPeriodDeclarations[i++] = decls.get( declr.getIdentifier() );
            }
View Full Code Here

        context.pushRuleComponent( timer );

        Declaration[][] declrs = null;
        if ( timer instanceof ExpressionIntervalTimer ) {
            Map<String, Declaration> outerDeclrs = context.getSubRule().getOuterDeclarations();
            ExpressionIntervalTimer exprTimer = ( ExpressionIntervalTimer timer;
            Declaration[] delayDeclrs = exprTimer.getDelayMVELCompilationUnit().getPreviousDeclarations();
            Declaration[] periodDeclrs = exprTimer.getPeriodMVELCompilationUnit().getPreviousDeclarations();

            delayDeclrs = Arrays.copyOf(delayDeclrs, delayDeclrs.length); // make copies as originals must not be changed
            periodDeclrs = Arrays.copyOf(periodDeclrs, delayDeclrs.length)// make copies as originals must not be changed

View Full Code Here

            }
            Arrays.sort( this.enabledDeclarations, SortDeclarations.instance );             
        }       
       
        if ( rule.getTimer() instanceof ExpressionIntervalTimer ) {
            ExpressionIntervalTimer expr = ( ExpressionIntervalTimer ) rule.getTimer();
           
            Declaration[] declrs = expr.getDelayMVELCompilationUnit().getPreviousDeclarations();           
            this.timerDelayDeclarations = new Declaration[declrs.length];
            int i = 0;
            for ( Declaration declr : declrs ) {
                this.timerDelayDeclarations[i++] = decls.get( declr.getIdentifier() );
            }
            Arrays.sort( this.timerDelayDeclarations, SortDeclarations.instance );     
           
            declrs = expr.getPeriodMVELCompilationUnit().getPreviousDeclarations();           
            this.timerPeriodDeclarations = new Declaration[declrs.length];
            i = 0;
            for ( Declaration declr : declrs ) {
                this.timerPeriodDeclarations[i++] = decls.get( declr.getIdentifier() );
            }
View Full Code Here

                period = MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context );
            } else {
                period = MVELObjectExpressionBuilder.build( "0", context );
            }

            timer = new ExpressionIntervalTimer( createMVELExpr(startDate, context), createMVELExpr(endDate, context), repeatLimit, times, period );
        } else {
            DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
                                                  "Protocol for timer does not exist '" + timerString +"'" );
            context.addError( err );
            return;
View Full Code Here

                period = MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context );
            } else {
                period = MVELObjectExpressionBuilder.build( "0", context );
            }

            timer = new ExpressionIntervalTimer( startDate, endDate, repeatLimit, times, period );
        } else {
            DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
                                                  "Protocol for timer does not exist '" + timerString +"'" );
            context.addError( err );
            return;
View Full Code Here

                period = MVELObjectExpressionBuilder.build( tok.nextToken().trim(), context );
            } else {
                period = MVELObjectExpressionBuilder.build( "0", context );
            }

            timer = new ExpressionIntervalTimer( createMVELExpr(startDate, context), createMVELExpr(endDate, context), repeatLimit, times, period );
        } else {
            DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
                                                  "Protocol for timer does not exist '" + timerString +"'" );
            context.addError( err );
            return;
View Full Code Here

            }
            Arrays.sort( this.enabledDeclarations, SortDeclarations.instance );             
        }       
       
        if ( rule.getTimer() instanceof ExpressionIntervalTimer ) {
            ExpressionIntervalTimer expr = ( ExpressionIntervalTimer ) rule.getTimer();
           
            Declaration[] declrs = expr.getDelayMVELCompilationUnit().getPreviousDeclarations();           
            this.timerDelayDeclarations = new Declaration[declrs.length];
            int i = 0;
            for ( Declaration declr : declrs ) {
                this.timerDelayDeclarations[i++] = decls.get( declr.getIdentifier() );
            }
            Arrays.sort( this.timerDelayDeclarations, SortDeclarations.instance );     
           
            declrs = expr.getPeriodMVELCompilationUnit().getPreviousDeclarations();           
            this.timerPeriodDeclarations = new Declaration[declrs.length];
            i = 0;
            for ( Declaration declr : declrs ) {
                this.timerPeriodDeclarations[i++] = decls.get( declr.getIdentifier() );
            }
View Full Code Here

TOP

Related Classes of org.drools.core.time.impl.ExpressionIntervalTimer

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.