Skip to content

Instantly share code, notes, and snippets.

@baldimir
Created March 6, 2018 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baldimir/94ef23595574d7cdcbb500d0e97059ed to your computer and use it in GitHub Desktop.
Save baldimir/94ef23595574d7cdcbb500d0e97059ed to your computer and use it in GitHub Desktop.
@Test
public void testDroolsContext() {
String str =
"global java.util.List list\n" +
"\n" +
"rule R when\n" +
"then\n" +
" list.add(kcontext);\n" +
"end";
KieSession ksession = getKieSession(str);
List<Object> list = new ArrayList<>();
ksession.setGlobal("list", list);
ksession.fireAllRules();
assertEquals( 1, list.size() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment