Package org.drools.command.runtime.rule

Examples of org.drools.command.runtime.rule.QueryCommand


        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);
       
        KnowledgeContextResolveFromContextCommand resolveFromContextCommand = new KnowledgeContextResolveFromContextCommand(setVariableCmd,
                null, null, "ksession", "localResults");
        ExecutionResults results = (ExecutionResults) commandService.execute(resolveFromContextCommand);
View Full Code Here


        return (T) this.commandService.execute( new ExecuteCommand( command ) );
    }

    public QueryResults getQueryResults(String query,
                                        Object... arguments) {
        QueryCommand cmd = new QueryCommand( (String)null,
                                             query,
                                             arguments );
        return this.commandService.execute( cmd );
    }
View Full Code Here

  }

  public void marshal(Object object,
                      HierarchicalStreamWriter writer,
                      MarshallingContext context) {
      QueryCommand cmd = (QueryCommand) object;
      writer.addAttribute( "out-identifier",
                           cmd.getOutIdentifier() );
      writer.addAttribute( "name",
                           cmd.getName() );
      if ( cmd.getArguments() != null ) {
          for ( Object arg : cmd.getArguments() ) {
              writeItem( arg,
                         context,
                         writer );
          }
      }
View Full Code Here

                                 context,
                                 null );
          args.add( arg );
          reader.moveUp();
      }
      QueryCommand cmd = new QueryCommand( outIdentifier,
                                           name,
                                           args.toArray( new Object[args.size()] ) );

      return cmd;
  }
View Full Code Here

TOP

Related Classes of org.drools.command.runtime.rule.QueryCommand

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.