Examples of FactHandle


Examples of org.drools.FactHandle

                                                     dynamic );
    }

    public void modifyObject(Object object) throws FactException
    {
        FactHandle handle = this.tuple.getFactHandleForObject( object );

        this.tuple.getWorkingMemory( ).modifyObject( handle,
                                                     object );
    }
View Full Code Here

Examples of org.drools.FactHandle

    }

    public void modifyObject( Object oldObject,
                              Object newObject ) throws FactException
    {
        FactHandle handle = this.tuple.getFactHandleForObject( oldObject );

        this.tuple.getWorkingMemory( ).modifyObject( handle,
                                                     newObject );
    }
View Full Code Here

Examples of org.drools.FactHandle

                                                     newObject );
    }

    public void retractObject( Object object ) throws FactException
    {
        FactHandle handle = this.tuple.getFactHandleForObject( object );

        this.tuple.getWorkingMemory( ).retractObject( handle );
    }
View Full Code Here

Examples of org.drools.FactHandle

        /* Create some facts */
        Cheese cheddar = new Cheese( "cheddar",
                                     5 );

        FactHandle f0 = workingMemory.createFactHandle( 0 );
        workingMemory.putObject( f0,
                                 cheddar );
        InstrumentedReteTuple tuple = new InstrumentedReteTuple( 0,
                                                                 f0,
                                                                 workingMemory );
View Full Code Here

Examples of org.drools.FactHandle

                                                                       new Declaration[]{typeOfCheeseDeclaration},
                                                                       new StringConstraintComparator( ConstraintComparator.EQUAL ) );

        Cheese cheddar0 = new Cheese( "cheddar",
                                      5 );
        FactHandle f0 = workingMemory.createFactHandle( 0 );
        workingMemory.putObject( f0,
                                 cheddar0 );
        InstrumentedReteTuple tuple = new InstrumentedReteTuple( 0,
                                                                 f0,
                                                                 workingMemory );

        Cheese cheddar1 = new Cheese( "cheddar",
                                      5 );
        FactHandle f1 = workingMemory.createFactHandle( 1 );
        workingMemory.putObject( f1,
                                 cheddar1 );
        tuple = new InstrumentedReteTuple( tuple,
                                           new InstrumentedReteTuple( 1,
                                                                      f1,
View Full Code Here

Examples of org.drools.FactHandle

                                                               price2Declaration,
                                                               new Declaration[]{price1Declaration} );

        Cheese cheddar0 = new Cheese( "cheddar",
                                      5 );
        FactHandle f0 = workingMemory.createFactHandle( 0 );
        workingMemory.putObject( f0,
                                 cheddar0 );
        InstrumentedReteTuple tuple = new InstrumentedReteTuple( 0,
                                                                 f0,
                                                                 workingMemory );

        Cheese cheddar1 = new Cheese( "cheddar",
                                      10 );
        FactHandle f1 = workingMemory.createFactHandle( 1 );
        workingMemory.putObject( f1,
                                 cheddar1 );
        tuple = new InstrumentedReteTuple( tuple,
                                           new InstrumentedReteTuple( 1,
                                                                      f1,
View Full Code Here

Examples of org.drools.FactHandle

                                                                       new Declaration[]{priceDeclaration},
                                                                       new NumericConstraintComparator( ConstraintComparator.GREATER ) );

        Cheese cheddar0 = new Cheese( "cheddar",
                                      5 );
        FactHandle f0 = workingMemory.createFactHandle( 0 );
        workingMemory.putObject( f0,
                                 cheddar0 );
        InstrumentedReteTuple tuple = new InstrumentedReteTuple( 0,
                                                                 f0,
                                                                 workingMemory );

        Cheese cheddar1 = new Cheese( "cheddar",
                                      10 );
        FactHandle f1 = workingMemory.createFactHandle( 1 );
        workingMemory.putObject( f1,
                                 cheddar1 );
        tuple = new InstrumentedReteTuple( tuple,
                                           new InstrumentedReteTuple( 0,
                                                                      f1,
View Full Code Here

Examples of org.drools.FactHandle

                            rule1 );
        ModuleImpl main = (ModuleImpl) agenda.getFocus();
        Activation activation1 = (Activation) main.getActivationQueue().get();

        String logicalString = new String ( "logical" );
        FactHandle logicalHandle = workingMemory.assertObject( logicalString,
                                                               false,
                                                               true,
                                                               rule1,
                                                               activation1 );
        agenda.removeFromAgenda( tuple1.getKey(),
View Full Code Here

Examples of org.drools.FactHandle

                            rule1 );
        ModuleImpl main = (ModuleImpl) agenda.getFocus();
        Activation activation1 = (Activation) main.getActivationQueue().get();

        String logicalString1 = new String( "logical" );
        FactHandle logicalHandle1 = workingMemory.assertObject( logicalString1,
                                                                false,
                                                                true,
                                                                rule1,
                                                                activation1 );

        String logicalString2 = new String( "logical" );
        FactHandle logicalHandle2 = workingMemory.assertObject( logicalString2,
                                                                false,
                                                                true,
                                                                rule1,
                                                                activation1 );
View Full Code Here

Examples of org.drools.FactHandle

                            rule1 );
        ModuleImpl main = (ModuleImpl) agenda.getFocus();
        Activation activation1 = (Activation) main.getActivationQueue().get();

        String logicalString1 = new String( "logical" );
        FactHandle logicalHandle1 = workingMemory.assertObject( logicalString1,
                                                               false,
                                                               true,
                                                               rule1,
                                                               activation1 );
       
        /* This assertion is stated and should override any previous justified
         * "equals" objects.
         */
        String logicalString2 = new String( "logical" );
        FactHandle logicalHandle2 = workingMemory.assertObject( logicalString2 );
       
        agenda.removeFromAgenda( tuple1.getKey(),
                                 context1,
                                 rule1 );
       
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.