Package org.kie.api.runtime.rule

Examples of org.kie.api.runtime.rule.AgendaFilter


    public TestingEventListener() {
    }

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

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


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

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

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

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

        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(Match 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( Match activation ) {
                if ( ruleNames.isEmpty() ) {
                    return true;
                }
                String ruleName = activation.getRule().getName();
View Full Code Here

    public TestingEventListener() {
    }

    public AgendaFilter getAgendaFilter( final HashSet<String> ruleNames,
                                         final boolean inclusive ) {
        return new AgendaFilter() {
            public boolean accept( Match activation ) {
                if ( ruleNames.isEmpty() ) {
                    return true;
                }
                String ruleName = activation.getRule().getName();
View Full Code Here

TOP

Related Classes of org.kie.api.runtime.rule.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.