Package org.drools.core.reteoo

Examples of org.drools.core.reteoo.ReteooRuleBase.newStatefulSession()


        context.put( BUILD_CONTEXT,
                     buildContext );
        context.put( "ClassFieldAccessorStore",
                     this.reteTesterHelper.getStore() );

        InternalWorkingMemory wm = (InternalWorkingMemory) rbase.newStatefulSession( true );
        context.put( WORKING_MEMORY,
                     wm );
        return context;
    }
View Full Code Here


        ReteooRuleBase rbase = new ReteooRuleBase("ID", conf);
        BuildContext buildContext = new BuildContext(rbase, rbase
                .getReteooBuilder().getIdGenerator());

        InternalWorkingMemory wm = (InternalWorkingMemory) rbase
                .newStatefulSession(true);

        // Overwrite values now taking into account the configuration options.
        context.put(BUILD_CONTEXT, buildContext);
        context.put(WORKING_MEMORY, wm);
View Full Code Here

     * @throws IntrospectionException
     */
    @Test
    public void testLiteralConstraint() throws IntrospectionException {
        final ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory workingMemory = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final ClassFieldReader extractor = store.getReader(Cheese.class,
                "type",
                getClass().getClassLoader());

View Full Code Here

     * @throws IntrospectionException
     */
    @Test
    public void testPrimitiveLiteralConstraint() throws IntrospectionException {
        final ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory workingMemory = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final ClassFieldReader extractor = store.getReader(Cheese.class,
                "price",
                getClass().getClassLoader());

View Full Code Here

     * @throws IntrospectionException
     */
    @Test
    public void testPredicateConstraint() throws IntrospectionException {
        final ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory workingMemory = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final InternalReadAccessor priceExtractor = store.getReader( Cheese.class,
                                                                     "price",
                                                                     getClass().getClassLoader() );

View Full Code Here

    @Test
    public void testNoLoopScheduledActivation() throws Exception {
        ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        IdGenerator idGenerator = ruleBase.getReteooBuilder().getIdGenerator();

        final AbstractWorkingMemory workingMemory = (AbstractWorkingMemory) ruleBase.newStatefulSession();
        final Agenda agenda = workingMemory.getAgenda();

        final Rule rule = new Rule("test-rule");
        final List data = new ArrayList();
View Full Code Here

    public void testAddition() {
        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setOption( RuleEngineOption.RETEOO );

        ReteooRuleBase rbase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase(conf);
        StatefulSession wm = rbase.newStatefulSession();

        InternalAgenda agenda = ( InternalAgenda ) wm.getAgenda();
        AgendaItem item1 = new RuleTerminalNodeLeftTuple();
        AgendaItem item2 = new RuleTerminalNodeLeftTuple();
        AgendaItem item3 = new RuleTerminalNodeLeftTuple();
View Full Code Here

    public void testRemoval() {
        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setOption( RuleEngineOption.RETEOO );

        ReteooRuleBase rbase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase(conf);
        StatefulSession wm = rbase.newStatefulSession();

        InternalAgenda agenda = ( InternalAgenda ) wm.getAgenda();
        AgendaItem item1 = new RuleTerminalNodeLeftTuple();
        AgendaItem item2 = new RuleTerminalNodeLeftTuple();
        AgendaItem item3 = new RuleTerminalNodeLeftTuple();
View Full Code Here

    public void testUnblockAll() {
        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setOption( RuleEngineOption.RETEOO );

        ReteooRuleBase rbase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase(conf);
        StatefulSession wm = rbase.newStatefulSession();

        InternalAgenda agenda = ( InternalAgenda ) wm.getAgenda();
        AgendaItem item1 = new RuleTerminalNodeLeftTuple();
        AgendaItem item2 = new RuleTerminalNodeLeftTuple();
        AgendaItem item3 = new RuleTerminalNodeLeftTuple();
View Full Code Here

    public void testKnowledgeHelperUpdate() {
        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setOption( RuleEngineOption.RETEOO );

        ReteooRuleBase rbase = ( ReteooRuleBase ) RuleBaseFactory.newRuleBase(conf);
        StatefulSession wm = rbase.newStatefulSession();

        InternalAgenda agenda = ( InternalAgenda ) wm.getAgenda();
        AgendaItem item1 = new RuleTerminalNodeLeftTuple();
        AgendaItem item2 = new RuleTerminalNodeLeftTuple();
        AgendaItem item3 = new RuleTerminalNodeLeftTuple();
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.