Package org.drools.time.impl

Examples of org.drools.time.impl.Timer


            Declaration target = constraint.getRequiredDeclarations()[0];
            if ( target.isPatternDeclaration() && target.getPattern().getObjectType().isEvent() ) {
                long uplimit = ((IntervalProviderConstraint) constraint).getInterval().getUpperBound();
                // only makes sense to add the new timer if the uplimit is not infinity (Long.MAX_VALUE)
                if( uplimit < Long.MAX_VALUE ) {
                    Timer timer = context.getRule().getTimer();
                    DurationTimer durationTimer = new DurationTimer( uplimit );

                    if ( timer instanceof CompositeMaxDurationTimer ) {
                        // already a composite so just add
                        ((CompositeMaxDurationTimer) timer).addDurationTimer( durationTimer );
View Full Code Here


            activationGroup.addActivation( activation );
        } else {
            if ( !previouslyActive ) {
                addActivation( activation, true );
            } else {
                Timer timer = activation.getRule().getTimer();
                if ( timer != null && timer instanceof ExpressionIntervalTimer ) {
                    ScheduledAgendaItem schItem = ( ScheduledAgendaItem ) activation;                   
                    removeScheduleItem( schItem );
                   
                    scheduleItem( schItem,
View Full Code Here

        }             
                              
        // adds item to activation group if appropriate
        addItemToActivationGroupitem );           
       
        final Timer timer = rule.getTimer();
        if ( timer != null && item instanceof ScheduledAgendaItem ) {
            ScheduledAgendaItem sitem = (ScheduledAgendaItem) item;
            if ( sitem.isEnqueued() ) {
                // it's about to be re-added to scheduled list, so remove first
                this.scheduledActivations.remove( sitem );
View Full Code Here

            return true;
        }

        final Rule rule = rtn.getRule();
        AgendaItem item;
        final Timer timer = rule.getTimer();
        if ( timer != null ) {
            if ( reuseActivation ) {
                item = ( AgendaItem ) tuple.getObject();  
                item.setPropagationContext( context );
            } else {
View Full Code Here

            repeatLimit = Integer.parseInt( timerString.substring( equalsPos + 1, p ).trim() );
        }
                    
        String body = timerString.substring( colonPos + 1, optionsPos ).trim();
       
        Timer timer = null;
        if ( "cron".equals( protocol ) ) {
            try {
                timer = new CronTimer( startDate, endDate, repeatLimit, new CronExpression( body ) );
            } catch ( ParseException e ) {
                DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
View Full Code Here

            activationGroup.addActivation( activation );
        } else {
            if ( !previouslyActive ) {
                addActivation( activation, true );
            } else {
                Timer timer = activation.getRule().getTimer();
                if ( timer != null && timer instanceof ExpressionIntervalTimer ) {
                    ScheduledAgendaItem schItem = ( ScheduledAgendaItem ) activation;                   
                    removeScheduleItem( schItem );
                   
                    scheduleItem( schItem,
View Full Code Here

        }             
                              
        // adds item to activation group if appropriate
        addItemToActivationGroupitem );           
       
        final Timer timer = rule.getTimer();
        if ( timer != null && item instanceof ScheduledAgendaItem ) {
            ScheduledAgendaItem sitem = (ScheduledAgendaItem) item;
            if ( sitem.getEnqueued().compareAndSet( true, false ) ) {
                // it's about to be re-added to scheduled list, so remove first
                this.scheduledActivations.remove( sitem );
View Full Code Here

            return true;
        }

        final Rule rule = rtn.getRule();
        AgendaItem item;
        final Timer timer = rule.getTimer();
        if ( timer != null ) {
            if ( reuseActivation ) {
                item = ( AgendaItem ) tuple.getObject();  
                item.setPropagationContext( context );
            } else {
View Full Code Here

            // variable constraints always require a single declaration
            Declaration target = constraint.getRequiredDeclarations()[0];
            if ( target.isPatternDeclaration() && target.getPattern().getObjectType().isEvent() ) {
                long uplimit = ((VariableConstraint) constraint).getInterval().getUpperBound();

                Timer timer = context.getRule().getTimer();
                DurationTimer durationTimer = new DurationTimer( uplimit );

                if ( timer instanceof CompositeMaxDurationTimer ) {
                    // already a composite so just add
                    ((CompositeMaxDurationTimer) timer).addDurationTimer( durationTimer );
View Full Code Here

        }             
                              
        // adds item to activation group if appropriate
        addItemToActivationGroupitem );           
       
        final Timer timer = rule.getTimer();
        if ( timer != null ) {
            scheduleItem( (ScheduledAgendaItem) item,
                          workingMemory );
        } else {               
            AgendaItem agendaItem =  ( AgendaItem ) item;
View Full Code Here

TOP

Related Classes of org.drools.time.impl.Timer

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.