Package org.drools.command.runtime

Examples of org.drools.command.runtime.GetGlobalCommand


  }

  public void marshal(Object object,
                      HierarchicalStreamWriter writer,
                      MarshallingContext context) {
      GetGlobalCommand cmd = (GetGlobalCommand) object;

      writer.addAttribute( "identifier",
                           cmd.getIdentifier() );

      if ( cmd.getOutIdentifier() != null ) {
          writer.addAttribute( "out-identifier",
                               cmd.getOutIdentifier() );
      }
  }
View Full Code Here


  public Object unmarshal(HierarchicalStreamReader reader,
                          UnmarshallingContext context) {
      String identifier = reader.getAttribute( "identifier" );
      String identifierOut = reader.getAttribute( "out-identifier" );

      GetGlobalCommand cmd = new GetGlobalCommand( identifier );
      if ( identifierOut != null ) {
          cmd.setOutIdentifier( identifierOut );
      }
      return cmd;
  }
View Full Code Here

        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            GetGlobalCommand cmd = (GetGlobalCommand) object;

            writer.startNode( "identifier" );
            writer.setValue( cmd.getIdentifier() );
            writer.endNode();

            if ( cmd.getOutIdentifier() != null ) {
                writer.startNode( "out-identifier" );
                writer.setValue( cmd.getOutIdentifier() );
                writer.endNode();
            }

        }
View Full Code Here

    public BatchExecutionCommandImpl createBatchExecutionCommand() {
        return new BatchExecutionCommandImpl();
    }
   
    public GetGlobalCommand createGetGlobalCommand() {
        return new GetGlobalCommand();
    }
View Full Code Here

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext context) {
            String identifier = null;
            String outIdentifier = null;
            GetGlobalCommand cmd = new GetGlobalCommand();

            while ( reader.hasMoreChildren() ) {
                reader.moveDown();
                String nodeName = reader.getNodeName();
                if ( "identifier".equals( nodeName ) ) {
                    identifier = reader.getValue();
                } else if ( "out-identifier".equals( nodeName ) ) {
                    outIdentifier = reader.getValue();
                }
                reader.moveUp();
            }

            cmd.setIdentifier( identifier );

            if ( outIdentifier != null ) {
                cmd.setOutIdentifier( outIdentifier );
            }
            return cmd;
        }
View Full Code Here

        setGlobal.setOut( true );

        cmd.getCommands().add( setGlobal );
        cmd.getCommands().add( new InsertObjectCommand( new Person( "baunax" ) ) );
        cmd.getCommands().add( new FireAllRulesCommand() );
        cmd.getCommands().add( new GetGlobalCommand( "list" ) );

        Marshaller marshaller = getJaxbContext().createMarshaller();
        marshaller.setProperty( "jaxb.formatted.output",
                                true );
        StringWriter xml = new StringWriter();
View Full Code Here

        List<GenericCommand< ? >> cmds = new ArrayList<GenericCommand< ? >>();
        cmds.add( new InsertObjectCommand( new Person( "darth",
                                                       21 ),
                                           "p" ) );
        cmds.add( new GetGlobalCommand( "xxx" ) );
        cmds.add( new SetGlobalCommand( "yyy",
                                        new Person( "yoda",
                                                    21 ) ) );
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImpl( cmds );
View Full Code Here

        SimulationStepImpl step4 = new SimulationStepImpl(path, 5000);
        List<Command> cmds4 = new ArrayList<Command>();

        cmds4.add( new AssertEquals( "Check List size",
                                    2,
                                    new GetGlobalCommand( "list" ),
                                    "size()" ) );
       
        cmds4.add( new AssertEquals( "Check Person",
                                    new Person( "darth",
                                                97 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 0 )" ) );

        cmds4.add(new AssertEquals("Check Person",
                new Person("yoda",
                        98),
                new GetGlobalCommand("list"),
                "get( 1 )"));

        step4.getCommands().add(new TestGroupCommand( "test1", cmds4));
        steps.add( step4 );
View Full Code Here

        SimulationStepImpl step24 = new SimulationStepImpl(path2,
                5000);
        List<Command> cmds24 = new ArrayList<Command>();
        cmds24.add(new AssertEquals("Check List size",
                5,
                new GetGlobalCommand("list"),
                "size()"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("bobba",
                        77),
                new GetGlobalCommand("list"),
                "get( 0 )" ) );

        cmds24.add(new AssertEquals("Check Person",
                new Person("darth",
                        97),
                new GetGlobalCommand("list"),
                "get( 1 )"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("luke",
                        30),
                new GetGlobalCommand("list"),
                "get( 2 )"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("yoda",
                        98),
                new GetGlobalCommand("list"),
                "get( 3 )"));

        cmds24.add(new AssertEquals("Check Person",
                new Person("ben",
                        150),
                new GetGlobalCommand("list"),
                "get( 4 )"));
        step24.getCommands().add(new TestGroupCommand("test2", cmds24));
        steps2.add(step24);

View Full Code Here

        cmds = new ArrayList<Command>();

        cmds.add( new AssertEquals( "Check List size",
                                    2,
                                    new GetGlobalCommand( "list" ),
                                    "size()" ) );
       
        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "darth",
                                                97 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 0 )" ) );

        cmds.add( new AssertEquals( "Check Person",
                                    new Person( "yoda",
                                                98 ),
                                    new GetGlobalCommand( "list" ),
                                    "get( 1 )" ) );

        steps.add( new StepImpl( path,
                                 new TestGroupCommand( "test1",
                                                       cmds ),
View Full Code Here

TOP

Related Classes of org.drools.command.runtime.GetGlobalCommand

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.