Examples of openLiveQuery()


Examples of org.drools.reteoo.ReteooWorkingMemoryInterface.openLiveQuery()

        final Map<String, Integer> map = new HashMap<String, Integer>();
        map.put("inserted", new Integer(0));
        map.put("deleted", new Integer(0));
        map.put("updated", new Integer(0));
        wm.openLiveQuery("peeps", new Object[] {Variable.v, 99 }, new ViewChangedEventListener() {
            public void rowAdded(Row row) {
                System.out.println( "inserted" );
                Integer integer = map.get("inserted");
                map.put("inserted", integer.intValue() + 1 );
            }
View Full Code Here

Examples of org.drools.reteoo.ReteooWorkingMemoryInterface.openLiveQuery()

        final Map<String, Integer> map = new HashMap<String, Integer>();
        map.put("inserted", new Integer(0));
        map.put("deleted", new Integer(0));
        map.put("updated", new Integer(0));
        wm.openLiveQuery("peeps", new Object[] {Variable.v, 99 }, new ViewChangedEventListener() {
            public void rowAdded(Row row) {
            }

            public void rowRemoved(Row row) {
            }
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

        org.drools.runtime.rule.FactHandle c2Fh = ksession.insert( cheddar2 );
        org.drools.runtime.rule.FactHandle c3Fh = ksession.insert( cheddar3 );
                     
        DroolsEventList list = new DroolsEventList();
        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses", new Object[] { "cheddar", "stilton" } , list );
       
        SortedList<Row> sorted = new SortedList<Row>( list, new Comparator<Row>() {

            public int compare(Row r1,
                               Row r2) {
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

                added.add( array );
            }
        };

        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses",
                                                  new Object[]{"stilton", "cheddar"},
                                                  listener );

        // Assert that on opening we have three rows added
        assertEquals( 3,
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

                added.add( array );
            }
        };

        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses",
                                                  new Object[]{"stilton", "cheddar"},
                                                  listener );

        // Assert that on opening we have three rows added
        assertEquals( 3,
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

                      notMemory.getRightTupleMemory().size() );

        // Now execute an open query and ensure the memory is left populated
        food.clear();
        final List foodUpdated = new ArrayList();
        LiveQuery query = ksession.openLiveQuery( "look",
                                                  new Object[]{"kitchen", Variable.v},
                                                  new ViewChangedEventListener() {

                                                      public void rowUpdated(Row row) {
                                                          foodUpdated.addAll( (Collection) row.get( "food" ) );
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

                added.add( array );
            }
        };       
       
        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses", new Object[] { "stilton", "cheddar" } , listener );
       
        // Assert that on opening we have three rows added
        assertEquals( 3, added.size() );
        assertEquals( 0, removed.size() );
        assertEquals( 0, updated.size() );
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

                added.add( array );
            }
        };

        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses",
                                                  new Object[]{"stilton", "cheddar"},
                                                  listener );

        // Assert that on opening we have three rows added
        assertEquals( 3,
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

                added.add( row.get( "$price" ) );
            }
        };       
       
        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses", new Object[] { "cheddar", "stilton" } , listener );
       
        // Assert that on opening we have three rows added
        assertEquals( 3, added.size() );
        assertEquals( 0, removed.size() );
        assertEquals( 0, updated.size() );
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.openLiveQuery()

        org.drools.runtime.rule.FactHandle c2Fh = ksession.insert( cheddar2 );
        org.drools.runtime.rule.FactHandle c3Fh = ksession.insert( cheddar3 );
                     
        DroolsEventList list = new DroolsEventList();
        // Open the LiveQuery
        LiveQuery query = ksession.openLiveQuery( "cheeses", new Object[] { "cheddar", "stilton" } , list );
       
        SortedList<Row> sorted = new SortedList<Row>( list, new Comparator<Row>() {

            public int compare(Row r1,
                               Row r2) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.