Package org.drools.command.runtime

Examples of org.drools.command.runtime.SetGlobalCommand


        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 );

        Marshaller marshaller = jaxbContext.createMarshaller();
View Full Code Here


    public Command newGetObjects(ObjectFilter filter, String outIdentifier) {
        return new GetObjectsCommand(filter, outIdentifier);
    }

    public Command newSetGlobal(String identifier, Object object) {
        return new SetGlobalCommand(identifier, object);
    }
View Full Code Here

        }
    }

    public Command newSetGlobal(String identifier, Object object,
            String outIdentifier) {
        SetGlobalCommand cmd = new SetGlobalCommand(identifier, object);
        cmd.setOutIdentifier(outIdentifier);
        return cmd;
    }
View Full Code Here

        return commandService.execute( new GetGlobalCommand( identifier ) );
    }

    public void setGlobal(String identifier,
                          Object object) {
        this.commandService.execute( new SetGlobalCommand( identifier,
                                                           object ) );
    }
View Full Code Here

        }

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

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

            if ( cmd.getOutIdentifier() != null ) {
                writer.startNode( "out-identifier" );
                writer.setValue( cmd.getOutIdentifier() );
                writer.endNode();
            } else if ( cmd.isOut() ) {
                writer.startNode( "out" );
                writer.setValue( Boolean.toString( cmd.isOut() ) );
                writer.endNode();
            }
            writeValue( writer,
                        context,
                        "object",
                        cmd.getObject() );

        }
View Full Code Here

                                UnmarshallingContext context) {
            String identifier = null;
            String out = null;
            String outIdentifier = null;
            Object object = null;
            SetGlobalCommand cmd = new SetGlobalCommand();

            while ( reader.hasMoreChildren() ) {
                reader.moveDown();
                String nodeName = reader.getNodeName();
                if ( "identifier".equals( nodeName ) ) {
                    identifier = reader.getValue();
                } else if ( "out".equals( nodeName ) ) {
                    out = reader.getValue();
                } else if ( "out-identifier".equals( nodeName ) ) {
                    outIdentifier = reader.getValue();
                } else if ( "object".equals( nodeName ) ) {
                    cmd.setObject( readValue( reader,
                                              context,
                                              cmd.getObject(),
                                              "object" ) );
                }
                reader.moveUp();
            }

            cmd.setIdentifier( identifier );

            if ( outIdentifier != null ) {
                cmd.setOutIdentifier( outIdentifier );
            } else if ( out != null ) {
                cmd.setOut( Boolean.parseBoolean( out ) );
            }
            return cmd;
        }
View Full Code Here

        return commandService.execute( new GetGlobalCommand( identifier ) );
    }

    public void setGlobal(String identifier,
                          Object object) {
        this.commandService.execute( new SetGlobalCommand( identifier,
                                                           object ) );
    }
View Full Code Here

    public GetGlobalCommand createGetGlobalCommand() {
        return new GetGlobalCommand();
    }
   
    public SetGlobalCommand createSetGlobalCommand() {
        return new SetGlobalCommand();
    }
View Full Code Here

        }

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

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

            if ( cmd.getOutIdentifier() != null ) {
                writer.addAttribute( "out-identifier",
                                     cmd.getOutIdentifier() );
            } else if ( cmd.isOut() ) {
                writer.addAttribute( "out",
                                     Boolean.toString( cmd.isOut() ) );
            }

            writeItem( cmd.getObject(),
                       context,
                       writer );
        }
View Full Code Here

            reader.moveDown();
            Object object = readItem( reader,
                                      context,
                                      null );
            reader.moveUp();
            SetGlobalCommand cmd = new SetGlobalCommand( identifier,
                                                         object );
            if ( identifierOut != null ) {
                cmd.setOutIdentifier( identifierOut );
            } else if ( out != null ) {
                cmd.setOut( Boolean.parseBoolean( out ) );
            }
            return cmd;
        }
View Full Code Here

TOP

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

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.