Package org.drools.runtime.rule

Examples of org.drools.runtime.rule.FactHandle.toExternalForm()


                            list );

        String outXml = execContent( "testFactHandleReturn.in.1" );

        assertXMLEqual( getContent( "testFactHandleReturn.expected.1",
                                    fh.toExternalForm() ),
                        outXml );

        ExecutionResults result = unmarshalOutXml( outXml,
                                                   ExecutionResults.class );
View Full Code Here


                                                   ExecutionResults.class );

        List outList = (List) result.getValue( "out-list" );
        assertEquals( 1,
                      outList.size() );
        assertEquals( fh.toExternalForm(),
                      ((FactHandle) outList.get( 0 )).toExternalForm() );
        assertNotSame( fh,
                       outList.get( 0 ) );
    }
View Full Code Here

        Object object = results.getValue( "outStilton" );

        assertEquals( "org.foo.Whee",
                      object.getClass().getName() );
        assertXMLEqual( getContent( "testInsertObjectWithDeclaredFact.expected.1",
                                    factHandle.toExternalForm() ),
                        outXml );

    }

    @Test @Ignore
View Full Code Here

            FactHandle fh = (FactHandle) results.getFactHandle( "outStilton" );

            outXml = execContent( "testInsertObjectWithDeclaredFactAndQuery.in.2" );

            assertXMLEqual( getContent( "testInsertObjectWithDeclaredFactAndQuery.expected.1",
                                        fh.toExternalForm() ),
                            outXml );
        } finally {
            Thread.currentThread().setContextClassLoader( orig );
        }
    }
View Full Code Here

        stilton = (Cheese) ksession.getObject( factHandle );
        assertEquals( 30,
                      stilton.getPrice() );

        assertXMLEqual( getContent( "testExecutionNodeLookup.expected.1",
                                    factHandle.toExternalForm() ),
                        outXml );
    }

    public static class TestWorkItemHandler
        implements
View Full Code Here

                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <get-object out-identifier='outStilton' fact-handle='" + factHandle.toExternalForm() + "' />";
        inXml += "</batch-execution>";
        outXml = template.requestBody( "direct:exec",
                                       inXml,
                                       String.class );
        result = template.requestBody( "direct:unmarshal",
View Full Code Here

                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <retract fact-handle='" + factHandle.toExternalForm() + "' />";
        inXml += "</batch-execution>";
        template.requestBody( "direct:exec",
                              inXml,
                              String.class );
View Full Code Here

                              inXml,
                              String.class );

        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <get-object out-identifier='outStilton' fact-handle='" + factHandle.toExternalForm() + "' />";
        inXml += "</batch-execution>";

        outXml = template.requestBody( "direct:exec",
                                       inXml,
                                       String.class );
View Full Code Here

        expectedXml += "      <type>stilton</type>\n";
        expectedXml += "      <oldPrice>0</oldPrice>\n";
        expectedXml += "      <price>30</price>\n";
        expectedXml += "    </org.drools.camel.testdomain.Cheese>\n";
        expectedXml += "  </result>\n";
        expectedXml += "  <fact-handle identifier=\"outStilton\" external-form=\"" + factHandle.toExternalForm() + "\" /> \n";
        expectedXml += "</execution-results>\n";

        assertXMLEqual( expectedXml,
                        outXml );
View Full Code Here

        assertXMLEqual( expectedXml,
                        outXml );

        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <modify fact-handle='" + factHandle.toExternalForm() + "'> <set accessor='oldPrice' value='42' /><set accessor='price' value='50' /></modify>";
        inXml += "  <fire-all-rules />";
        inXml += "</batch-execution>";
        template.requestBody( "direct:exec",
                              inXml,
                              String.class );
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.