"@end{}" +
"" +
"@declare{\"cedX\"}@{connect}@foreach{child : args}" +
"@includeNamed{\"ced\"; node=child; }@end{} @{connect}@end{}";
TemplateRegistry reportRegistry = new SimpleTemplateRegistry();
reportRegistry.addNamedTemplate("drl", TemplateCompiler.compileTemplate(template));
TemplateRuntime.execute(reportRegistry.getNamedTemplate("drl"), null, reportRegistry);
Map<String, Object> context = new HashMap<String, Object>();
context.put( "root", new Node( 2,
Arrays.asList( new Node( 1,
Collections.EMPTY_LIST ) ) ) );
String result = (String) TemplateRuntime.execute( reportRegistry.getNamedTemplate( "drl" ),
null,
new MapVariableResolverFactory( context ),
reportRegistry );
assertEquals("OR AND AND OR", result);