Package org.drools.compiler

Examples of org.drools.compiler.Cell


        env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                 new ObjectMarshallingStrategy[]{
                 new IdentityPlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );
        StatefulKnowledgeSession session = createKnowledgeSession( kbase, null, env );

        final Cell cell1 = new Cell( 9 );
        final Cell cell = new Cell( 0 );

        session.insert( cell1 );
        org.kie.api.runtime.rule.FactHandle cellHandle = session.insert( cell );

        session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
                                                                             true );

        session.fireAllRules();
        assertEquals( 9,
                      cell.getValue() );
    }
View Full Code Here


                     "end\n";

        KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

        Cell c1 = new Cell( 1, 2, 0 );
        Cell c2 = new Cell( 1, 3, 0 );
        ksession.insert( c1 );
        ksession.insert( c2 );

        int rules = ksession.fireAllRules();
        assertEquals( 1,
View Full Code Here

         env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                  new ObjectMarshallingStrategy[]{
                  new IdentityPlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );
         StatefulKnowledgeSession session = createKnowledgeSession( kbase, null, env );

         final Cell cell1 = new Cell( 9 );
         final Cell cell = new Cell( 0 );

         session.insert( cell1 );
         FactHandle cellHandle = session.insert( cell );

         session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
                                                                              true );

         session.fireAllRules();
         assertEquals( 9,
                       cell.getValue() );
     }
View Full Code Here

                      "end\n";

         KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

         Cell c1 = new Cell( 1, 2, 0 );
         Cell c2 = new Cell( 1, 3, 0 );
         ksession.insert( c1 );
         ksession.insert( c2 );

         int rules = ksession.fireAllRules();
         assertEquals( 1,
View Full Code Here

        FactHandle[][] handles = new FactHandle[size][];
        for ( int row = 0; row < size; row++ ) {
            cells[row] = new Cell[size];
            handles[row] = new FactHandle[size];
            for ( int col = 0; col < size; col++ ) {
                cells[row][col] = new Cell( Cell.DEAD, row, col );
                handles[row][col] = (FactHandle) ksession.insert( cells[row][col] );
                if ( row >= 1 && col >= 1 ) {
                    // northwest
                    ksession.insert( new Neighbor( cells[row - 1][col - 1],
                                                  cells[row][col] ) );
View Full Code Here

        FactHandle[][] handles = new FactHandle[size][];
        for ( int row = 0; row < size; row++ ) {
            cells[row] = new Cell[size];
            handles[row] = new FactHandle[size];
            for ( int col = 0; col < size; col++ ) {
                cells[row][col] = new Cell( Cell.DEAD, row, col );
                handles[row][col] = (FactHandle) ksession.insert( cells[row][col] );
                if ( row >= 1 && col >= 1 ) {
                    // northwest
                    ksession.insert( new Neighbor( cells[row - 1][col - 1],
                                                  cells[row][col] ) );
View Full Code Here

         env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                  new ObjectMarshallingStrategy[]{
                  new IdentityPlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );
         StatefulKnowledgeSession session = createKnowledgeSession( kbase, null, env );

         final Cell cell1 = new Cell( 9 );
         final Cell cell = new Cell( 0 );

         session.insert( cell1 );
         org.kie.api.runtime.rule.FactHandle cellHandle = session.insert( cell );

         session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
                                                                              true );

         session.fireAllRules();
         assertEquals( 9,
                       cell.getValue() );
     }
View Full Code Here

                      "end\n";

         KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
         StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

         Cell c1 = new Cell( 1, 2, 0 );
         Cell c2 = new Cell( 1, 3, 0 );
         ksession.insert( c1 );
         ksession.insert( c2 );

         int rules = ksession.fireAllRules();
         assertEquals( 1,
View Full Code Here

        env.set( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES,
                 new ObjectMarshallingStrategy[]{
                 new IdentityPlaceholderResolverStrategy( ClassObjectMarshallingStrategyAcceptor.DEFAULT )} );
        StatefulKnowledgeSession session = createKnowledgeSession( kbase, null, env );

        final Cell cell1 = new Cell( 9 );
        final Cell cell = new Cell( 0 );

        session.insert( cell1 );
        org.kie.api.runtime.rule.FactHandle cellHandle = session.insert( cell );

        session = SerializationHelper.getSerialisedStatefulKnowledgeSession( session,
                                                                             true );

        session.fireAllRules();
        assertEquals( 9,
                      cell.getValue() );
    }
View Full Code Here

                     "end\n";

        KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

        Cell c1 = new Cell( 1, 2, 0 );
        Cell c2 = new Cell( 1, 3, 0 );
        ksession.insert( c1 );
        ksession.insert( c2 );

        int rules = ksession.fireAllRules();
        assertEquals( 1,
View Full Code Here

TOP

Related Classes of org.drools.compiler.Cell

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.