String localId = UUID.randomUUID().toString();
CommandImpl registerKAgentCmd = new CommandImpl( "execute",
Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
localId+"_kAgent",
new KnowledgeContextResolveFromContextCommand( new RegisterKAgentRemoteCommand( localId ),
null,
this.instanceId,
null,
kresultsId ) )} ) );
ConversationUtil.sendMessage( this.cm,
(InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
this.gsd.getId(),
registerKAgentCmd );
CommandImpl newSessionCmd = new CommandImpl( "execute",
Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
localId,
new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionFromKAgentRemoteCommand( conf , environment, localId),
null,
this.instanceId,
null,
kresultsId ) )} ) );