Package org.drools.core.spi

Examples of org.drools.core.spi.AgendaFilter


        // test agenda is empty
        assertEquals(0,
                     agenda.getFocus().size());

        // True filter, activations should always add
        final AgendaFilter filterTrue = new

                AgendaFilter() {
                    public boolean accept(Activation item) {
                        return true;
                    }
                };

        rule.setNoLoop(false);
        node.assertLeftTuple(tuple,
                             context,
                             workingMemory);

        agenda.unstageActivations();

        // check there is an item to fire
        assertEquals(1,
                     agenda.getFocus().size());
        agenda.fireNextItem(filterTrue, 0, -1);

        // check focus is empty
        assertEquals(0,
                     agenda.getFocus().size());

        // make sure it also fired
        assertEquals(new Boolean(true),
                     results.get("fired"));

        assertEquals(false,
                     filtered[0].booleanValue());

        // clear the agenda and the result map
        agenda.clearAndCancel();
        results.clear();

        // False filter, activations should always be denied
        final AgendaFilter filterFalse = new

                AgendaFilter() {
                    public boolean accept(Activation item) {
                        return false;
                    }
View Full Code Here


    public TestingEventListener() {
    }

    public AgendaFilter getAgendaFilter(final HashSet<String> ruleNames, final boolean inclusive) {
        return new AgendaFilter() {
            public boolean accept(Activation activation) {
                if (ruleNames.size() ==0) return true;
                String ruleName = activation.getRule().getName();

                http://www.wtf.com
View Full Code Here

TOP

Related Classes of org.drools.core.spi.AgendaFilter

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.