Examples of newWorkingMemory()


Examples of org.drools.RuleBase.newWorkingMemory()

        File dotFile = new File( DOT_FILE );
        System.out.println( "Creating DOT: " + dotFile.getCanonicalPath() + "..." );
        new ReteDumper( ruleBase ).dumpReteToDot( new PrintStream( new FileOutputStream( dotFile ) ) );

        this.workingMemory = ruleBase.newWorkingMemory();

        this.workingMemory.addEventListener( new WaltzWMEL() );

        System.out.println( "Reading DAT: " + datFile + "..." );
        this.inputObjects = getInputObjects( this.getClass().getResourceAsStream( datFile ) );
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

        RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
        ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
        RuleBase ruleBase = ruleBaseLoader.buildRuleBase();       
       

        workingMemory = ruleBase.newWorkingMemory( );
    }

    protected void tearDown( )
    {
        workingMemory = null;
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

        in.readObject( );
        in.close( );

        // JSR-94 Tests
        // Reset the session. [ruleSession.reset();]
        WorkingMemory newWorkingMemory = ruleBase.newWorkingMemory( );
        assertNotNull("WMNotNullTest ", newWorkingMemory);

        // Retrieve all the objects, nothing should be here. The
        // reset should have taken care of the removal.
        // [ruleSession.getObjects();]
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

        InstrumentedTupleSink sink = new InstrumentedTupleSink( );

        source.addTupleSink( sink );

        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );
        WorkingMemory workingMemory = ruleBase.newWorkingMemory( );

        Rule rule = new Rule( "test-rule" );

        //add consequence
        rule.setConsequence( new org.drools.spi.InstrumentedConsequence( ) );
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

        TerminalNode node = new TerminalNode( new MockTupleSource( ), rule );

        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );

        ReteTuple tuple = new ReteTuple( (WorkingMemoryImpl) ruleBase.newWorkingMemory( ) );

        node.assertTuple( tuple, memory );

        assertLength( 1, agenda.getAdded( ) );
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

{
    public void testScheduledActivation() throws Exception
    {
        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );

        WorkingMemoryImpl workingMemory = (WorkingMemoryImpl) ruleBase.newWorkingMemory( );
        final Scheduler scheduler = Scheduler.getInstance( );

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

Examples of org.drools.RuleBase.newWorkingMemory()

    public void testExceptionHandler() throws Exception
    {
        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );

        WorkingMemoryImpl workingMemory = (WorkingMemoryImpl) ruleBase.newWorkingMemory( );
        final Scheduler scheduler = Scheduler.getInstance( );

        final Rule rule = new Rule( "test-rule" );

        rule.addParameterDeclaration( "paramVar",
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

       
        RuleBaseLoader ruleBaseLoader = new RuleBaseLoader();
        ruleBaseLoader.addFromRuleSetLoader(ruleSetLoader);
        RuleBase ruleBase = ruleBaseLoader.buildRuleBase();             

        WorkingMemory workingMemory = ruleBase.newWorkingMemory( );

        State a = new State( "A" );
        State b = new State( "B" );
        State c = new State( "C" );
        State d = new State( "D" );
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

        Rule rule = new Rule( "test-rule" );

        Declaration decl = rule.addParameterDeclaration( "cheese", new MockObjectType( true ) );

        ReteTuple tuple = new ReteTuple( (WorkingMemoryImpl) ruleBase.newWorkingMemory( ), decl, handle );

        InstrumentedConsequence consequence = new InstrumentedConsequence( );

        rule.setConsequence( consequence );
View Full Code Here

Examples of org.drools.RuleBase.newWorkingMemory()

{
    public void testAddToAgenda() throws Exception
    {
        RuleBase ruleBase = new RuleBaseImpl( new Rete( ) );

        WorkingMemoryImpl workingMemory = (WorkingMemoryImpl) ruleBase.newWorkingMemory( );
        final Agenda agenda = workingMemory.getAgenda( );

        final Rule rule = new Rule( "test-rule" );

        // add consequence
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.