Examples of InsertElementsCommand


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

    @Test
    public void testInsertElements() throws Exception {

        BatchExecutionCommandImpl cmd = new BatchExecutionCommandImpl();
        cmd.setLookup( "ksession1" );
        InsertElementsCommand elems = new InsertElementsCommand( "elems" );
        elems.getObjects().add( new Person( "lucaz",
                                            25 ) );
        elems.getObjects().add( new Person( "hadrian",
                                            25 ) );
        elems.getObjects().add( new Person( "baunax",
                                            21 ) );
        elems.getObjects().add( "xxx" );

        cmd.getCommands().add( elems );
        cmd.getCommands().add( new FireAllRulesCommand() );

        StringWriter xmlReq = new StringWriter();
View Full Code Here

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

    public GetObjectsCommand createGetObjectsCommand() {
        return new GetObjectsCommand();
    }
   
    public InsertElementsCommand createInsertElementsCommand() {
        return new InsertElementsCommand();
    }
View Full Code Here

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

        cmd.setOutIdentifier(outIdentifier);
        return cmd;
    }

    public Command newInsertElements(Collection objects) {
        return new InsertElementsCommand(objects);
    }
View Full Code Here

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

    public Command newInsertElements(Collection objects) {
        return new InsertElementsCommand(objects);
    }

    public Command newInsertElements(Collection objects, String outIdentifier, boolean returnObject, String entryPoint) {
        InsertElementsCommand cmd = new InsertElementsCommand(objects);
        cmd.setEntryPoint( entryPoint );
        cmd.setOutIdentifier( outIdentifier );
        cmd.setReturnObject( returnObject );
        return cmd;
    }
View Full Code Here

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

        }

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

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

                writer.startNode( "return-objects" );
                writer.setValue( Boolean.toString( cmd.isReturnObject() ) );
                writer.endNode();

            }
            if ( !StringUtils.isEmpty( cmd.getEntryPoint() ) ) {
                writer.startNode( "entry-point" );
                writer.setValuecmd.getEntryPoint() );
                writer.endNode();
            }

            for ( Object element : cmd.getObjects() ) {
                writeItem( new ObjectsObjectContainer( element ),
                           context,
                           writer );
            }
        }
View Full Code Here

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

  }

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

      if ( cmd.getOutIdentifier() != null ) {
          writer.addAttribute( "out-identifier",
                               cmd.getOutIdentifier() );

          writer.addAttribute( "return-objects",
                               Boolean.toString( cmd.isReturnObject() ) );
         
         
          writer.addAttribute( "entry-point",
                               cmd.getEntryPoint() );

      }

      for ( Object element : cmd.getObjects() ) {
          writeItem( element,
                     context,
                     writer );
      }
  }
View Full Code Here

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

                                    null );
          reader.moveUp();
          objects.add( object );
      }

      InsertElementsCommand cmd = new InsertElementsCommand( objects );
      if ( identifierOut != null ) {
          cmd.setOutIdentifier( identifierOut );
          if ( returnObject != null ) {
              cmd.setReturnObject( Boolean.parseBoolean( returnObject ) );
          }
      }
      if ( entryPoint != null ) {
          cmd.setEntryPoint( entryPoint );
      }
      return cmd;
  }
View Full Code Here

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

                } else {
                    throw new IllegalArgumentException( "insert-elements does not support the child element name=''" + reader.getNodeName() + "' value=" + reader.getValue() + "'" );
                }
                reader.moveUp();
            }
            InsertElementsCommand cmd = new InsertElementsCommand( objects );
            if ( outIdentifier != null ) {
                cmd.setOutIdentifier( outIdentifier );
                if ( outIdentifier != null ) {
                    cmd.setReturnObject( Boolean.parseBoolean( returnObjects ) );
                }
            }
            if ( entryPoint != null ) {
                cmd.setEntryPoint( entryPoint );
            }
            return cmd;
        }
View Full Code Here

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

    cmd.setOutIdentifier(outIdentifier);
    return cmd;
  }

  public Command newInsertElements(Collection objects) {
      return new InsertElementsCommand(objects);
  }
View Full Code Here

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

  public Command newInsertElements(Collection objects) {
      return new InsertElementsCommand(objects);
  }
 
    public Command newInsertElements(Collection objects, String outIdentifier, boolean returnObject, String entryPoint) {
        InsertElementsCommand cmd = new InsertElementsCommand(objects);
        cmd.setEntryPoint( entryPoint );
        cmd.setOutIdentifier( outIdentifier );
        cmd.setReturnObject( returnObject );
        return cmd;
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.