Package org.kie.api.event.rule

Examples of org.kie.api.event.rule.AgendaEventListener


        KnowledgeBase kbase = loadKnowledgeBaseFromString(str);
        StatelessKieSession ksession = kbase.newStatelessKnowledgeSession();

        final List<String> firings = new ArrayList<String>();

        AgendaEventListener agendaEventListener = new AgendaEventListener() {
            public void matchCreated(org.kie.api.event.rule.MatchCreatedEvent event) {
            }

            public void matchCancelled(org.kie.api.event.rule.MatchCancelledEvent event) {
            }
View Full Code Here


        final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        List<String> res = new ArrayList<String>();
        ksession.setGlobal( "results", res );

        AgendaEventListener agendaEventListener = new AgendaEventListener() {
            public void matchCreated(org.kie.api.event.rule.MatchCreatedEvent event) {
            }

            public void matchCancelled(org.kie.api.event.rule.MatchCancelledEvent event) {
            }
View Full Code Here

        KnowledgeBase kbase = loadKnowledgeBaseFromString(str);
        StatelessKieSession ksession = kbase.newStatelessKnowledgeSession();

        final List<String> firings = new ArrayList<String>();

        AgendaEventListener agendaEventListener = new AgendaEventListener() {
            public void matchCreated(org.kie.api.event.rule.MatchCreatedEvent event) {
            }

            public void matchCancelled(org.kie.api.event.rule.MatchCancelledEvent event) {
            }
View Full Code Here

    public void execTestAccumulateMultipleFunctions( String fileName ) throws Exception {
        KnowledgeBase kbase = loadKnowledgeBase( fileName );
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

        AgendaEventListener ael = mock( AgendaEventListener.class );
        ksession.addEventListener( ael );

        final Cheese[] cheese = new Cheese[]{new Cheese( "stilton",
                                                          10 ),
                                              new Cheese( "stilton",
View Full Code Here

    public void execTestAccumulateMultipleFunctionsConstraint( String fileName ) throws Exception {
        KnowledgeBase kbase = loadKnowledgeBase( fileName );
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

        AgendaEventListener ael = mock( AgendaEventListener.class );
        ksession.addEventListener( ael );

        final Cheese[] cheese = new Cheese[]{new Cheese( "stilton",
                                                          10 ),
                                              new Cheese( "stilton",
View Full Code Here

        final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        List<String> res = new ArrayList<String>();
        ksession.setGlobal( "results", res );

        AgendaEventListener agendaEventListener = new AgendaEventListener() {
            public void matchCreated(org.kie.api.event.rule.MatchCreatedEvent event) {
            }

            public void matchCancelled(org.kie.api.event.rule.MatchCancelledEvent event) {
            }
View Full Code Here

                     "  System.out.println( \"Rule2\" ); \n" +
                     "end";
        KnowledgeBase kb = loadKnowledgeBaseFromString( drl );
        StatefulKnowledgeSession ks = kb.newStatefulKnowledgeSession();

        ks.addEventListener( new AgendaEventListener() {
            int step = 0;

            public void matchCreated( MatchCreatedEvent event ) {}

            public void matchCancelled( MatchCancelledEvent event ) {
View Full Code Here

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(ksessionConfig,
                                                                              null);

        WorkingMemoryEventListener wml = mock(WorkingMemoryEventListener.class);
        ksession.addEventListener(wml);
        AgendaEventListener ael = mock(AgendaEventListener.class);
        ksession.addEventListener(ael);

        PseudoClockScheduler clock = (PseudoClockScheduler) ksession.<SessionClock> getSessionClock();

        final StockTickInterface st1 = new StockTick(1,
View Full Code Here

        kconf.setOption(EventProcessingOption.STREAM);
        KnowledgeBase kbase = loadKnowledgeBaseFromString(kconf,
                                                          drl);

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        AgendaEventListener ael = mock(AgendaEventListener.class);
        ksession.addEventListener(ael);

        EntryPoint ep = ksession.getEntryPoint("ticks");
        ep.insert(new StockTick(1, "ACME", 20, 1000)); // not in the window
        ep.insert(new StockTick(2, "RHT", 20, 1000)); // not > 20
View Full Code Here

        kconf.setOption(EventProcessingOption.STREAM);
        KnowledgeBase kbase = loadKnowledgeBaseFromString(kconf,
                                                          drl);

        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
        AgendaEventListener ael = mock(AgendaEventListener.class);
        ksession.addEventListener(ael);

        EntryPoint ep = ksession.getEntryPoint("data");
        ep.insert(Double.valueOf( 10 ));
        ep.insert(Double.valueOf( 11 ));
View Full Code Here

TOP

Related Classes of org.kie.api.event.rule.AgendaEventListener

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.