Package org.drools.command

Examples of org.drools.command.SetVariableCommandFromCommand


        commandService = new DefaultCommandService(kContext);
        List cmds = new ArrayList();
       
        QueryCommand queryCommand = new QueryCommand("out", "myQuery", new Object[]{});
        SetVariableCommandFromCommand setVariableCmd = new SetVariableCommandFromCommand("__TEMP__", "query123", queryCommand);
        cmds.add(setVariableCmd);
       
        BatchExecutionCommand batchCmd = CommandFactory.newBatchExecution(cmds, "kresults");
        ExecuteCommand execCmd = new ExecuteCommand(batchCmd,true);
       
View Full Code Here


        kContext.set("ksession", ksession);

        commandService = new DefaultCommandService(kContext);
       
        QueryCommand queryCommand = new QueryCommand("out", "myQuery", new Object[]{});
        SetVariableCommandFromCommand setVariableCmd = new SetVariableCommandFromCommand("__TEMP__", "query123", queryCommand);
       
        KnowledgeContextResolveFromContextCommand resolveFromContextCommand = new KnowledgeContextResolveFromContextCommand(setVariableCmd,
                null, null, "ksession", "localResults");
        ExecutionResults results = (ExecutionResults) commandService.execute(resolveFromContextCommand);
View Full Code Here

                                                                Environment environment) {
        String kresultsId = "kresults_" + this.cm.toString();
        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,
View Full Code Here

        String remoteConfId = null;
        if(conf != null) {
            remoteConfId = ((KnowledgeBuilderConfigurationRemoteClient)conf).getId();
        }
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                          localId,
                                                                                                          new NewKnowledgeBuilderRemoteCommand( remoteConfId ) )} ) );

        ConversationManager connm = this.grid.get( ConversationManager.class );
        ConversationUtil.sendMessage( connm,
View Full Code Here

        } else {
            localId = kbaseId;
        }

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new NewKnowledgeBaseCommand( conf ) )} ) );
        ConversationManager connm = this.grid.get( ConversationManager.class );
        ConversationUtil.sendMessage( connm,
                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
View Full Code Here

                                                                Environment environment) {
        String kresultsId = "kresults_" + this.cm.toString();
        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 ) )} ) );
       
        this.sendMessage(registerKAgentCmd);
       
        String ksessionConfId = null;
        if (conf != null){
            ((KnowledgeSessionConfigurationRemoteClient)conf).getId();
        }
        
        CommandImpl newSessionCmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionFromKAgentRemoteCommand( ksessionConfId , environment, localId),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
                                                                                                                                               null,
View Full Code Here

       
        String kbaseConfId = ((KnowledgeBaseConfigurationRemoteClient)conf).getId();
       

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new NewKnowledgeBaseRemoteCommand( kbaseConfId ) )} ) );
        ConversationManager connm = this.grid.get( ConversationManager.class );
        ConversationUtil.sendMessage( connm,
                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
View Full Code Here

        } else {
            localId = UUID.randomUUID().toString();
        }
       
        CommandImpl registerKAgentCmd = new CommandImpl( "registerKAgent",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId+"_kAgent",
                                                                                                new KnowledgeContextResolveFromContextCommand( new RegisterKAgentRemoteCommand( localId ),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
                                                                                                                                               null,
                                                                                                                                               kresultsId ) )} ) );
       
        this.sendMessage(registerKAgentCmd);
       
        String ksessionConfId = null;
        if (conf != null){
            ((KnowledgeSessionConfigurationRemoteClient)conf).getId();
        }
        
        CommandImpl newSessionCmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionFromKAgentRemoteCommand( ksessionConfId , null, localId),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
                                                                                                                                               null,
View Full Code Here

        String remoteConfId = null;
        if(conf != null) {
            remoteConfId = ((KnowledgeBuilderConfigurationRemoteClient)conf).getId();
        }
        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                          localId,
                                                                                                          new NewKnowledgeBuilderRemoteCommand( remoteConfId ) )} ) );

        ConversationManager connm = this.grid.get( ConversationManager.class );
        ConversationUtil.sendMessage( connm,
View Full Code Here

        String kbaseConfId = ((KnowledgeBaseConfigurationRemoteClient)conf).getId();
       

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommandFromCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new NewKnowledgeBaseRemoteCommand( kbaseConfId ) )} ) );
        ConversationManager connm = this.grid.get( ConversationManager.class );
        ConversationUtil.sendMessage( connm,
                                      (InetSocketAddress) this.gsd.getAddresses().get( "socket" ).getObject(),
View Full Code Here

TOP

Related Classes of org.drools.command.SetVariableCommandFromCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.