Package org.drools.time.impl

Examples of org.drools.time.impl.Timer


            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


            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

            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 );
                    durationTimer.setEventFactHandleDecl( target );

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

        if ( this.rule.isNoLoop() && this.rule.equals( context.getRuleOrigin() ) ) {
            agenda.increaseDormantActivations();
            return;
        }

        final Timer timer = this.rule.getTimer();

        if ( timer != null ) {
            final ScheduledAgendaItem item = agenda.createScheduledAgendaItem( tuple,
                                                                               context,
                                                                               this.rule,
View Full Code Here

        if ( this.rule.isNoLoop() && this.rule.equals( context.getRuleOrigin() ) ) {
            agenda.increaseDormantActivations();
            return;
        }

        final Timer timer = this.rule.getTimer();

        if ( timer != null ) {
            if ( item == null ) {
                item = agenda.createScheduledAgendaItem( leftTuple,
                                                         context,
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

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.