Examples of FactHandle


Examples of org.drools.FactHandle

        inList.add( 1 );
        inList.add( 3 );
        inList.add( 6 );
        inList.add( 25 );

        FactHandle handle = session.insert( inList );
        session.startProcess( "ConstraintDialects" );
        assertEquals( 4,
                      outList.size() );
        assertEquals( "MVELCodeConstraint was here",
                      outList.get( 0 ) );
View Full Code Here

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

        this.handles = new FactHandle[ Math.max( left.handles.length, right.handles.length ) ];

        System.arraycopy( left.handles, 0, this.handles, 0, left.handles.length );

        int hashCode = left.hashCode;
        FactHandle handle;

        for ( int i = right.handles.length - 1; i >= 0; i-- )
        {
            handle = right.handles[ i ];
            if ( handle != null && this.handles[ i ] == null )
            {
                this.handles[ i ] = handle;
                hashCode += handle.hashCode( );
            }
        }

        this.hashCode = hashCode;
    }
View Full Code Here

Examples of org.drools.FactHandle

        if ( other.handles.length > this.handles.length )
        {
            return false;
        }

        FactHandle handle;
        for ( int i = other.handles.length - 1; i >= 0; i-- )
        {
            handle = other.handles[ i ];
            if ( handle != null && !handle.equals( this.handles[ i ] ) )
            {
                return false;
            }
        }
        return true;
View Full Code Here

Examples of org.drools.FactHandle

    /**
     * @see Tuple
     */
    public Object get(Declaration declaration)
    {
        FactHandle handle = this.key.get( declaration );
        if (handle != null)
        {
            try
            {
                return this.workingMemory.getObject( handle );
View Full Code Here

Examples of org.drools.FactHandle

            workingMemory = ruleBase.newWorkingMemory( );                       
           
            lounge.setTemperature(292);
            bedroom.setTemperature(292);

            FactHandle loungeHandle = workingMemory.assertObject( lounge );
            FactHandle bedroomHandle = workingMemory.assertObject( bedroom );
            FactHandle heatingHandle = workingMemory.assertObject( heating );           
            workingMemory.fireAllRules( );

            lounge.setTemperature(295);
            bedroom.setTemperature(295);
View Full Code Here

Examples of org.drools.FactHandle

    /**
     * @see WorkingMemory
     */
    public FactHandle getFactHandle(Object object) throws NoSuchFactHandleException
    {
        FactHandle factHandle = (FactHandle) this.handles.get( object );

        if ( factHandle == null )
        {
            throw new NoSuchFactHandleException( object );
        }
View Full Code Here

Examples of org.drools.FactHandle

    }

    public FactHandle assertObject(Object object,
                                   boolean dynamic) throws FactException
    {
        FactHandle handle = (FactHandle) handles.get( object );

        if ( handle != null )
        {
            return handle;
        }
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.