KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
ksession = createKnowledgeSession(kbase);
List<Command<?>> commands = new ArrayList<Command<?>>();
commands.add(new NewKnowledgeBuilderCommand());
commands.add(new KnowledgeBuilderAddCommand( ResourceFactory.newByteArrayResource(ruleString.getBytes()), ResourceType.DRL, null));
commands.add(new KnowledgeBuilderGetKnowledgePackagesCommand("pkgs"));
Command<?> cmds = CommandFactory.newBatchExecution( commands );
ExecutionResults result = (ExecutionResults) ksession.execute( cmds );
assertNotNull(result);