Package org.kie.api.runtime.rule

Examples of org.kie.api.runtime.rule.FactHandle.toExternalForm()


        ksession.update(atomicFH, value);
        ksession.fireAllRules();
       
        assertEquals( 2,
                list.size() );
        String externalForm = atomicFH.toExternalForm();
       
        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), kbase, null, env);
       
        atomicFH = ksession.execute(CommandFactory.fromExternalFactHandleCommand(externalForm));
       
View Full Code Here


                            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

        ksession.update(atomicFH, value);
        ksession.fireAllRules();
       
        assertEquals( 2,
                list.size() );
        String externalForm = atomicFH.toExternalForm();
       
        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(ksession.getId(), kbase, null, env);
       
        atomicFH = ksession.execute(CommandFactory.fromExternalFactHandleCommand(externalForm));
       
View Full Code Here

                            HierarchicalStreamWriter writer,
                            MarshallingContext marshallingContext) {
            FactHandle fh = (FactHandle) object;
            //writer.startNode("fact-handle");
            writer.addAttribute( "external-form",
                                 fh.toExternalForm() );
            //writer.endNode();
        }

        public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader,
                                UnmarshallingContext unmarshallingContext) {
View Full Code Here

        public void marshal(Object object,
                            HierarchicalStreamWriter writer,
                            MarshallingContext marshallingContext) {
            FactHandle fh = (FactHandle) object;
            writer.startNode( "external-form" );
            writer.setValue( fh.toExternalForm() );
            writer.endNode();
        }

        public Object unmarshal(HierarchicalStreamReader reader,
                                UnmarshallingContext unmarshallingContext) {
View Full Code Here

                            HierarchicalStreamWriter writer,
                            MarshallingContext marshallingContext) {
            FactHandle fh = (FactHandle) object;
            //writer.startNode("fact-handle");
            writer.addAttribute( "external-form",
                                 fh.toExternalForm() );
            //writer.endNode();
        }

        public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader,
                                UnmarshallingContext unmarshallingContext) {
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.