Package org.drools

Examples of org.drools.StatefulSession.dispose()


            session.insert(new Count(1));

            long start = System.currentTimeMillis();
            session.fireAllRules();
            System.err.println(System.currentTimeMillis() - start);
            session.dispose();
        }
    }

    /**
     * Convert the facts from the <code>InputStream</code> to a list of
View Full Code Here


        session.fireAllRules();

//        logger.writeToDisk();
       
        session.dispose(); // Stateful rule session must always be disposed when finished       
    }

}
View Full Code Here

                        dynamic );
        session.insert( d,
                        dynamic );

        session.fireAllRules();
        session.dispose();

//        logger.writeToDisk();
    }

}
View Full Code Here

            throw new IllegalArgumentException("Could not read drl", ex);
        }
        ruleBase.addPackage( builder.getPackage() );

        session.fireAllRules();
        session.dispose();

//        logger.writeToDisk();
    }

}
View Full Code Here

        builder = new PackageBuilder();
        builder.addPackageFromDrl( new InputStreamReader( StateExampleWithDynamicRules.class.getResourceAsStream( "StateExampleDynamicRule.drl" ) ) );
        ruleBase.addPackage( builder.getPackage() );

        session.fireAllRules();
        session.dispose();

        logger.writeToDisk();
    }

}
View Full Code Here

        session.fireAllRules();

        logger.writeToDisk();
       
        session.dispose(); // Stateful rule session must always be disposed when finished       
    }

}
View Full Code Here

                        dynamic );
        session.insert( d,
                        dynamic );

        session.fireAllRules();
        session.dispose();

        logger.writeToDisk();
    }

}
View Full Code Here

        assertEquals( bob.getObject(),
                      list.get( 1 ) );
        assertEquals( "stilton",
                      list.get( 2 ) );

        session.dispose();

    }

    @Test
    public void testSerializationOfIndexedWM() throws Exception {
View Full Code Here

                             ksession );
        baos.close();

        GlobalResolver resolver = session.getGlobalResolver();
        byte[] serializedRulebase = DroolsStreamUtils.streamOut( ruleBase );
        session.dispose();

        // now deserialize the rulebase, deserialize the session and test it
        ruleBase = (RuleBase) DroolsStreamUtils.streamIn( serializedRulebase );

        marshaller = MarshallerFactory.newMarshaller( new KnowledgeBaseImpl( ruleBase ) );
View Full Code Here

                                                                    ruleBase );

        serializedRulebase = DroolsStreamUtils.streamOut( ruleBase );

        // dispose session
        session.dispose();

    }

    /*
     *  Here I am inserting data points(e.g. Cheese) with  'stilton' / 'brie' as type value.
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.