ksession = kbase.newStatefulKnowledgeSession();
ExecutionResultImpl localKresults = new ExecutionResultImpl();
WorldImpl worldImpl = new WorldImpl();
worldImpl.createContext("__TEMP__");
worldImpl.getContext("__TEMP__").set("__TEMP__", new ContextImpl("__TEMP__", null));
ResolvingKnowledgeCommandContext kContext = new ResolvingKnowledgeCommandContext(worldImpl);
kContext.set("localResults", localKresults);
kContext.set("ksession", ksession);
commandService = new DefaultCommandService(kContext);
QueryCommand queryCommand = new QueryCommand("out", "myQuery", new Object[]{});
SetVariableCommandFromCommand setVariableCmd = new SetVariableCommandFromCommand("__TEMP__", "query123", queryCommand);