Package org.drools.spi

Examples of org.drools.spi.Duration


       
       
       
       

        Duration dur = rule.getDuration( );

        if ( dur != null && dur.getDuration( tuple ) > 0 )
        {
            // check if item has been retracted as part of a modify
            AgendaItem item = null;
            if ( !this.scheduledItemsToRetract.isEmpty( ) )
            {
View Full Code Here


        Configuration config = this.ruleSetReader.endConfiguration( );
        SemanticModule module = this.ruleSetReader.lookupSemanticModule( uri,
                                                                    localName );

        DurationFactory factory = module.getDurationFactory( localName );
        Duration duration;
        try
        {
            Rule rule = (Rule) this.ruleSetReader.getParent( Rule.class );

            duration = factory.newDuration( rule,
View Full Code Here

                data.add( "tested" );
            }
        } );

        /* 1/10th of a second */
        Duration duration = new Duration()
        {
            public long getDuration(Tuple tuple)
            {
                return 100;
            }
View Full Code Here

        final Rule rule = new Rule( "test-rule" );
        final List data = new ArrayList();

        /* 1/10th of a second */
        Duration duration = new Duration()
        {
            public long getDuration(Tuple tuple)
            {
                return 100;
            }
View Full Code Here

        final Rule rule = new Rule( "test-rule" );
        final List data = new ArrayList();

        /* 1/10th of a second */
        Duration duration = new Duration()
        {
            public long getDuration(Tuple tuple)
            {
                return 100;
            }
View Full Code Here

                                                rule );
            }
        } );

        /* 1/10th of a second */
        Duration duration = new Duration()
        {
            public long getDuration(Tuple tuple)
            {
                return 100;
            }
View Full Code Here

        if ( rule.getNoLoop( ) && rule.equals( context.getRuleOrigin( ) ) )
        {
            return;
        }

        Duration dur = rule.getDuration( );

        AgendaItem item = new AgendaItem( tuple,
                                          context,
                                          rule );
       
        /* set the focus if rule autoFocus is true */
        if ( rule.getAutoFocus() )
        {
            setFocus( rule.getModule() );
        }

        if ( dur != null && dur.getDuration( tuple ) > 0 )
        {
            this.scheduledItems.put( item.getKey( ),
                                     item );
            scheduleItem( item );
            this.workingMemory.getAgendaEventSupport( ).fireActivationCreated( rule,
View Full Code Here

    {
        Rule rule = new Rule( "test-rule" );

        rule.setDuration( 42L );

        Duration dur = rule.getDuration( );

        assertNotNull( dur );

        assertTrue( dur instanceof FixedDuration );
View Full Code Here

                      rule.getDuration( ).getDuration( null ) );
    }

    public void testDuration_WithObject() throws Exception
    {
        Duration dur = new FixedDuration( 42 );

        Rule rule = new Rule( "test-rule" );

        rule.setDuration( dur );
View Full Code Here

            }
        } );

        /* 1/10th of a second */
        final Duration duration = new Duration() {
            /**
             *
             */
            private static final long serialVersionUID = 400L;

View Full Code Here

TOP

Related Classes of org.drools.spi.Duration

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.