List cmds = new ArrayList();
cmds.add(new InsertObjectCommand(new String("Hi!"), "handle"));
BatchExecutionCommand batchCmd = CommandFactory.newBatchExecution(cmds, "kresults");
ExecuteCommand execCmd = new ExecuteCommand(batchCmd,true);
KnowledgeContextResolveFromContextCommand resolveFromContextCommand = new KnowledgeContextResolveFromContextCommand(execCmd,
null,null,"ksession","localResults");
ExecutionResults results = (ExecutionResults)commandService.execute(resolveFromContextCommand);
assertNotNull(results);
assertNotNull(results.getFactHandle("handle"));
assertTrue(((DefaultFactHandle)results.getFactHandle("handle")).isDisconnected());
cmds = new ArrayList();
cmds.add(new InsertObjectCommand(new String("Hi!"), "handle"));
batchCmd = CommandFactory.newBatchExecution(cmds, "kresults");
execCmd = new ExecuteCommand(batchCmd);
resolveFromContextCommand = new KnowledgeContextResolveFromContextCommand(execCmd,
null,null,"ksession","localResults");
results = (ExecutionResults)commandService.execute(resolveFromContextCommand);
assertNotNull(results);