Package org.drools.command

Examples of org.drools.command.SetVariableCommand


        List<Step> steps = new ArrayList<Step>();

        List<Command> cmds = new ArrayList<Command>();

        cmds.add( new SetVariableCommand( "path1",
                                          "kbuilder",
                                          new NewKnowledgeBuilderCommand( null ) ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new KnowledgeBuilderAddCommand( ResourceFactory.newByteArrayResource( str.getBytes() ),
                                                                                                 ResourceType.DRL,
                                                                                                 null ),
                                                                 "kbuilder",
                                                                 null,
                                                                 null, null ) );

        cmds.add( new SetVariableCommand( "path1",
                                          "kbase",
                                          new NewKnowledgeBaseCommand( null ) ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new KnowledgeBaseAddKnowledgePackagesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 null, null ) );

        KnowledgeSessionConfiguration ksessionConf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
        ksessionConf.setOption( ClockTypeOption.get( "pseudo" ) );

        cmds.add( new SetVariableCommand( "path1",
                                          "ksession",
                                          new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionCommand( ksessionConf ),
                                                                                         "kbuilder",
                                                                                         "kbase",
                                                                                         null, null ) ) );
View Full Code Here


        List<Step> steps = new ArrayList<Step>();

        List<Command> cmds = new ArrayList<Command>();

        cmds.add( new SetVariableCommand( "ROOT",
                                          "kbuilder",
                                          new NewKnowledgeBuilderCommand( null ) ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new KnowledgeBuilderAddCommand( ResourceFactory.newByteArrayResource( str.getBytes() ),
                                                                                                 ResourceType.DRL,
                                                                                                 null ),
                                                                 "kbuilder",
                                                                 null,
                                                                 null, null ) );

        cmds.add( new SetVariableCommand( "ROOT",
                                          "kbase",
                                          new NewKnowledgeBaseCommand( null ) ) );

        cmds.add( new KnowledgeContextResolveFromContextCommand( new KnowledgeBaseAddKnowledgePackagesCommand(),
                                                                 "kbuilder",
                                                                 "kbase",
                                                                 null, null ) );

        KnowledgeSessionConfiguration ksessionConf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
        ksessionConf.setOption( ClockTypeOption.get( "pseudo" ) );

        cmds.add( new SetVariableCommand( "ROOT",
                                          "ksession",
                                          new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionCommand( ksessionConf ),
                                                                                         "kbuilder",
                                                                                         "kbase",
                                                                                         null, null ) ) );
View Full Code Here

        String localId = UUID.randomUUID().toString();

        Message msg = new Message( messageSession.getSessionId(),
                                   messageSession.counter.incrementAndGet(),
                                   false,
                                   new SetVariableCommand( "__TEMP__",
                                                           localId,
                                                           new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionCommand( null ),
                                                                                                          null,
                                                                                                          instanceId,
                                                                                                          null,
View Full Code Here

        String localId = UUID.randomUUID().toString();

        Message msg = new Message( messageSession.getSessionId(),
                                   messageSession.counter.incrementAndGet(),
                                   false,
                                   new SetVariableCommand( "__TEMP__",
                                                           localId,
                                                           new NewKnowledgeBuilderCommand( null ) ) );

        try {
            Object object = client.write( msg ).getPayload();
View Full Code Here

        String localId = UUID.randomUUID().toString();

        Message msg = new Message( messageSession.getSessionId(),
                                   messageSession.counter.incrementAndGet(),
                                   false,
                                   new SetVariableCommand( "__TEMP__",
                                                           localId,
                                                           new NewKnowledgeBaseCommand( null ) ) );
        try {
            Object object = client.write( msg ).getPayload();
View Full Code Here

        } else {
            localId = kbaseId;
        }

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommand( "__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

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

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

                                                                Environment environment) {
        String kresultsId = "kresults_" + this.cm.toString();
        String localId = UUID.randomUUID().toString();

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionCommand( conf , environment),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
                                                                                                                                               null,
View Full Code Here

                                                                Environment environment) {
        String kresultsId = "kresults_" + this.cm.toString();
        String localId = UUID.randomUUID().toString();

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new KnowledgeContextResolveFromContextCommand( new NewStatefulKnowledgeSessionCommand( conf , environment),
                                                                                                                                               null,
                                                                                                                                               this.instanceId,
                                                                                                                                               null,
View Full Code Here

       
        String localId = "query_"+UUID.randomUUID().toString();
        String kresultsId = "kresults_" + this.gsd.getId();

        CommandImpl cmd = new CommandImpl( "execute",
                                           Arrays.asList( new Object[]{new SetVariableCommand( "__TEMP__",
                                                                                                localId,
                                                                                                new KnowledgeContextResolveFromContextCommand( new QueryRemoteCommand(localId+query, query, arguments),
                                                                                                                     null,
                                                                                                                      null,
                                                                                                                      this.instanceId,
View Full Code Here

TOP

Related Classes of org.drools.command.SetVariableCommand

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.