Package org.drools.core.command.runtime.rule

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


    }

    @Test
    public void testSessionGetObject() throws Exception {
        FactHandle factHandle = new DefaultFactHandle( handle );
        GetObjectCommand cmd = (GetObjectCommand) CommandFactory.newGetObject( factHandle );
        cmd.setOutIdentifier( "rider" );

        ExecutionResults response = (ExecutionResults) template.requestBody( "direct:test-with-session",
                                                                             cmd );
        assertTrue( "Expected valid ExecutionResults object",
                    response != null );
View Full Code Here


    }

    @Test
    public void testMarshallGetObjectCommand() {
        String xmlCommand = "<get-object fact-handle=\"0:234:345:456:567:789\" out-identifier=\"test\"/>";
        GetObjectCommand command = (GetObjectCommand) marshaller.fromXML(xmlCommand);
        assertEquals("test", command.getOutIdentifier());

        assertEquals("<get-object fact-handle=\"0:234:345:456:567:789:NON_TRAIT\" out-identifier=\"test\"/>", marshaller.toXML(command));
    }
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

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

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

    @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

    }

    @Test
    public void testSessionGetObject() throws Exception {
        FactHandle factHandle = new DefaultFactHandle( handle );
        GetObjectCommand cmd = (GetObjectCommand) CommandFactory.newGetObject( factHandle );
        cmd.setOutIdentifier( "rider" );

        ExecutionResults response = (ExecutionResults) template.requestBody( "direct:test-with-session",
                                                                             cmd );
        assertTrue( "Expected valid ExecutionResults object",
                    response != null );
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

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

    public Object getObject(FactHandle factHandle) {
        return commandService.execute( new GetObjectCommand( factHandle ) );
    }
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

TOP

Related Classes of org.drools.core.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.