@Test public void testGo() { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(); List<String> list = new ArrayList<String>(); ksession.setGlobal( "list", list ); ksession.fireAllRules(); assertEquals( 2, list.size() ); assertTrue( list.contains( "car" ) ); assertTrue( list.contains( "ball" ) ); list.clear(); ksession.insert("Debbie"); ksession.fireAllRules(); ksession.fireAllRules(); assertEquals( 1, list.size() ); assertTrue( list.contains( "doll" ) ); }
public void go() { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(); List<String> list = new ArrayList<String>(); ksession.setGlobal( "list", list ); ksession.fireAllRules(); System.out.println(list); list.clear(); ksession.insert("Debbie"); ksession.fireAllRules(); System.out.println( list ); }
ReactiveKieSessionExample { public void go() { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(); List<String> list = new ArrayList<String>(); ksession.setGlobal( "list", list ); ksession.fireAllRules(); System.out.println(list); list.clear(); ksession.insert("Debbie"); ksession.fireAllRules(); System.out.println( list ); } }
ReactiveKieSessionExample { public void go() { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(); List<String> list = new ArrayList<String>(); ksession.setGlobal( "list", list ); ksession.fireAllRules(); System.out.println(list); list.clear(); ksession.insert("Debbie"); ksession.fireAllRules(); System.out.println( list ); }  }
ReactiveKieSessionExample { public void go() { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(); List<String> list = new ArrayList<String>(); ksession.setGlobal( "list", list ); ksession.fireAllRules(); System.out.println(list); list.clear(); ksession.insert("Debbie"); ksession.fireAllRules(); System.out.println( list ); }  static void main(String[] args); void go(); }
ReactiveKieSessionExample { public void go() { KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession ksession = kContainer.newKieSession(); List<String> list = new ArrayList<String>(); ksession.setGlobal( "list", list ); ksession.fireAllRules(); System.out.println(list); list.clear(); ksession.insert("Debbie"); ksession.fireAllRules(); System.out.println( list ); }  static void main(String[] args); void go();  }