Package org.drools.io

Examples of org.drools.io.RuleBaseLoader


        String ruleText = getTestRuleSet( ).toXML( );               
               
        RuleSetLoader ruleSetLoader = new RuleSetLoader();          
        ruleSetLoader.addFromReader( new StringReader( ruleText ) );           
       
        RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
        ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
        RuleBase ruleBase = ruleBaseLoader.buildRuleBase();
        assertNotNull( ruleBase );
    }
View Full Code Here


        try
        {          
            RuleSetLoader ruleSetLoader = new RuleSetLoader();          
            ruleSetLoader.addFromReader(new StringReader( ruleset.toXML( ) ) );           
           
            RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
            ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
            ruleBaseLoader.buildRuleBase();           
           
            fail( );
        }
        catch ( IntegrationException e )
        {
View Full Code Here

        try
        {
            RuleSetLoader ruleSetLoader = new RuleSetLoader();          
            ruleSetLoader.addFromReader(new StringReader( ruleset.toXML( ) ) );           
           
            RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
            ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
            RuleBase ruleBase = ruleBaseLoader.buildRuleBase();     
            fail( );
        }
        catch ( Exception e )
        {
            System.out.println( e.toString( ) );
View Full Code Here

        Ruleset ruleSet = RulesetToDRLTest.getTestRuleSet( );
              
        RuleSetLoader ruleSetLoader = new RuleSetLoader();          
        ruleSetLoader.addFromReader(new StringReader( ruleSet.toXML( ) ) );           
       
        RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
        ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
        RuleBase ruleBase = ruleBaseLoader.buildRuleBase();          

        WorkingMemory engine = ruleBase.newWorkingMemory( );
        engine.assertObject( "yes" );
        engine.fireAllRules( );
    }
View Full Code Here

       
       
        RuleSetLoader ruleSetLoader = new RuleSetLoader();          
        ruleSetLoader.addFromReader( reader);           
       
        RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
        ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
        return ruleBaseLoader.buildRuleBase();                          
    }
View Full Code Here

            System.out.println( "loading drl file: " + conwayDrlFile );
           
            RuleSetLoader ruleSetLoader = new RuleSetLoader();          
            ruleSetLoader.addFromUrl( CellGrid.class.getResource( conwayDrlFile ) );           
           
            RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
            ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
            ruleBase = ruleBaseLoader.buildRuleBase();               
        }
        catch ( Exception e )
        {
            throw new RuntimeException( "Unable To Initialise RuleBaseFactory:\n" + e.getMessage() );
        }
View Full Code Here

        try
        {
            RuleSetLoader ruleSetLoader = new RuleSetLoader();          
            ruleSetLoader.addFromUrl( FibonacciExample.class.getResource( args[ 0 ] ) );           
           
            RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
            ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
            RuleBase ruleBase = ruleBaseLoader.buildRuleBase();
              

            WorkingMemory workingMemory;
            Fibonacci fibonacci;
            long start;
View Full Code Here

    {
        System.out.println( "Loading DRL: " + DRL_FILE + "..." );
        RuleSetLoader ruleSetLoader = new RuleSetLoader();          
        ruleSetLoader.addFromUrl( MannersBenchmark.class.getResource( DRL_FILE ) );           
       
        RuleBaseLoader ruleBaseLoader = new RuleBaseLoader(ComplexityConflictResolver.getInstance( ));
        ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
        RuleBase ruleBase = ruleBaseLoader.buildRuleBase();        
       
        File dotFile = new File( DOT_FILE );
        System.out.println( "Creating DOT: " + dotFile.getCanonicalPath() + "..." );
       
       
View Full Code Here

        try
        {
            RuleSetLoader ruleSetLoader = new RuleSetLoader();          
            ruleSetLoader.addFromUrl( PetStore.class.getResource( args[0] ) );           
           
            RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
            ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
            RuleBase ruleBase = ruleBaseLoader.buildRuleBase();                 
           

            Vector stock = new Vector( );
            stock.add( new CartItem( "Gold Fish", 5 ) );
            stock.add( new CartItem( "Fish Tank", 25 ) );
View Full Code Here

            Heating heating = new Heating();           
           
            RuleSetLoader ruleSetLoader = new RuleSetLoader();          
            ruleSetLoader.addFromUrl( HouseExample.class.getResource( "house.drl" ) );           
           
            RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
            ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
            RuleBase ruleBase = ruleBaseLoader.buildRuleBase();           
           
            // Dumper dumper = new Dumper(ruleBase);
            // dumper.dumpRete(System.err);

            WorkingMemory workingMemory;
View Full Code Here

TOP

Related Classes of org.drools.io.RuleBaseLoader

Copyright © 2018 www.massapicom. 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.