Package org.drools.command.runtime.rule

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


    @Test
    public void testSessionGetObject() throws Exception {

        BatchExecutionCommandImpl cmd = new BatchExecutionCommandImpl();
        cmd.setLookup( "ksession1" );
        cmd.getCommands().add( new GetObjectCommand( new DefaultFactHandle( handle ),
                                                     "hadrian" ) );

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


    public Calendars getCalendars() {
        return commandService.execute( new GetCalendarsCommand() );
    }

    public Object getObject(FactHandle factHandle) {
        return commandService.execute( new GetObjectCommand( factHandle ) );
    }
View Full Code Here

                             List<Setter> setters) {
        return new ModifyCommand(factHandle, setters);
    }

    public Command newGetObject(FactHandle factHandle) {
        return new GetObjectCommand(factHandle);
    }
View Full Code Here

    public Command newGetObject(FactHandle factHandle) {
        return new GetObjectCommand(factHandle);
    }

    public Command newGetObject(FactHandle factHandle, String outIdentifier) {
        return new GetObjectCommand(factHandle, outIdentifier);
    }
View Full Code Here

        }

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext context) {
            GetObjectCommand cmd = (GetObjectCommand) object;
            writer.startNode( "fact-handle" );
            writer.setValue( cmd.getFactHandle().toExternalForm() );
            writer.endNode();

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

                    outIdentifier = reader.getValue();
                }
                reader.moveUp();
            }

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

  }

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

      writer.addAttribute( "fact-handle",
                           cmd.getFactHandle().toExternalForm() );

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

  public Object unmarshal(HierarchicalStreamReader reader,
                          UnmarshallingContext context) {
      FactHandle factHandle = new DefaultFactHandle( reader.getAttribute( "fact-handle" ) );
      String identifierOut = reader.getAttribute( "out-identifier" );

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

                             List<Setter> setters) {
        return new ModifyCommand(factHandle, setters);
    }   
 
    public Command newGetObject(FactHandle factHandle) {
        return new GetObjectCommand(factHandle);
   
View Full Code Here

    public Calendars getCalendars() {
        return commandService.execute( new GetCalendarsCommand() );
    }

    public Object getObject(FactHandle factHandle) {
        return commandService.execute( new GetObjectCommand( factHandle ) );
    }
View Full Code Here

TOP

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

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.