Package org.drools.core.reteoo

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


       
        buildContext.setRule( rule );

        pctxFactory = conf.getComponentFactory().getPropagationContextFactory();
       
        rbase.addPackage( pkg );
        context.put( BUILD_CONTEXT,
                     buildContext );
        context.put( "ClassFieldAccessorStore",
                     this.reteTesterHelper.getStore() );
View Full Code Here


        pkg.setClassFieldAccessorCache( new ClassFieldAccessorCache( Thread.currentThread().getContextClassLoader() ) );
        JavaDialectRuntimeData data = new JavaDialectRuntimeData();
        data.onAdd( pkg.getDialectRuntimeRegistry(), rb.getRootClassLoader()  );
        pkg.getDialectRuntimeRegistry().setDialectData( "java", data );
       
        rb.addPackage( pkg );
       
        final JavaDialectRuntimeData pcData = ( JavaDialectRuntimeData ) pkg.getDialectRuntimeRegistry().getDialectData( "java" );
       
       
        final EvalCondition invoker = new EvalCondition(null);
View Full Code Here

        PackageDescr packageDescr = parser.parse(null, drl);
        PackageBuilder builder = new PackageBuilder();
        builder.addPackage(packageDescr);
        Package pkg = builder.getPackage();
        ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase(RuleBase.RETEOO);
        ruleBase.addPackage(pkg);

        final ReteooVisitor visitor = new ReteooVisitor( graph );
        visitor.visit( ruleBase );

        BaseVertex root = visitor.getRootVertex();
View Full Code Here

        final PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "test_" + name + ".drl" ) ) );
        final Package pkg = builder.getPackage();

        final ReteooRuleBase ruleBase = (ReteooRuleBase) getRuleBase();
        ruleBase.addPackage( pkg );

        if ( this.writeTree ) {
            writeRuleBase( ruleBase,
                           name );
        }
View Full Code Here

        PackageDescr packageDescr = parser.parse(drl);
        PackageBuilder builder = new PackageBuilder();
        builder.addPackage(packageDescr);
        Package pkg = builder.getPackage();
        ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase(RuleBase.RETEOO);
        ruleBase.addPackage(pkg);

        final ReteooVisitor visitor = new ReteooVisitor( graph );
        visitor.visit( ruleBase );

        BaseVertex root = visitor.getRootVertex();
View Full Code Here

        assertTrue( "Should not have errors",
                    pkgBuilder.getErrors().isEmpty() );

        // Add once ...
        ReteooRuleBase rb = new ReteooRuleBase( "dummy" );
        rb.addPackage( pkgBuilder.getPackage() );

        // This one works
        List list = new ArrayList();
        StatefulSession session = rb.newStatefulSession();
        session.setGlobal( "list",
View Full Code Here

                      list.size() );

        list.clear();
        // ... remove ...
        rb.removePackage( pkgBuilder.getPackage().getName() );
        rb.addPackage( pkgBuilder.getPackage() );
        session = rb.newStatefulSession();
        session.setGlobal( "list",
                           list );
        session.fireAllRules();
        assertEquals( 1,
View Full Code Here

                Package pkg = drlInfo.getPackage();
                RuleBaseConfiguration config = new RuleBaseConfiguration();
                config.setClassLoader(newLoader);
                ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase(RuleBase.RETEOO, config);
                if (pkg != null) {
                    ruleBase.addPackage(pkg);
                }
            } catch ( Throwable t ) {
                DroolsEclipsePlugin.log( t );
                throw new Exception( MSG_PARSE_ERROR + " " + t.getMessage());
            }
View Full Code Here

       
        buildContext.setRule( rule );

        pctxFactory = conf.getComponentFactory().getPropagationContextFactory();
       
        rbase.addPackage( pkg );
        context.put( BUILD_CONTEXT,
                     buildContext );
        context.put( "ClassFieldAccessorStore",
                     this.reteTesterHelper.getStore() );
View Full Code Here

                Package pkg = drlInfo.getPackage();
                RuleBaseConfiguration config = new RuleBaseConfiguration();
                config.setClassLoader(newLoader);
                ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase(RuleBase.RETEOO, config);
                if (pkg != null) {
                    ruleBase.addPackage(pkg);
                }
            } catch ( Throwable t ) {
                DroolsEclipsePlugin.log( t );
                throw new Exception( MSG_PARSE_ERROR + " " + t.getMessage());
            }
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.