Package org.drools.beliefsystem

Examples of org.drools.beliefsystem.BeliefSet


                                     final Activation activation,
                                     final PropagationContext context,
                                     final Rule rule,
                                     final ObjectTypeConf typeConf,
                                     final boolean read) throws FactException {
        BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet == null ) {
            if ( context.getType() == PropagationContext.MODIFICATION ) {
                // if this was a  update, chances  are its trying  to retract a logical assertion
            }
            beliefSet = beliefSystem.newBeliefSet( handle );
View Full Code Here


        }

        public void execute(InternalWorkingMemory workingMemory) {
            NamedEntryPoint nep = (NamedEntryPoint) handle.getEntryPoint() ;
           
            BeliefSet bs = handle.getEqualityKey().getBeliefSet();
            bs.setWorkingMemoryAction( null );
           
            if ( update ) {
                if ( !bs.isEmpty() ) {
                    // We need the isEmpty check, in case the BeliefSet was made empty (due to retract) after this was scheduled
                    ((NamedEntryPoint) handle.getEntryPoint() ).update( handle, true, handle.getObject(), Long.MAX_VALUE, null );
                }
            } else  {
                if ( fullyRetract ) {
View Full Code Here

import org.drools.spi.PropagationContext;

public class TruthMaintenanceSystemHelper {

    public static void removeLogicalDependencies(final InternalFactHandle handle, final PropagationContext propagationContext ) throws FactException {
        final BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet != null && !beliefSet.isEmpty() ) {
            beliefSet.cancel(propagationContext);
        }
    }
View Full Code Here

            beliefSet.cancel(propagationContext);
        }
    }
   
    public static void clearLogicalDependencies(final InternalFactHandle handle, final PropagationContext propagationContext ) throws FactException {
        final BeliefSet beliefSet = handle.getEqualityKey().getBeliefSet();
        if ( beliefSet != null && !beliefSet.isEmpty() ) {
            beliefSet.clear(propagationContext);
        }
    }   
View Full Code Here

        activation.setLogicalDependencies( null );
    }

    public static void removeLogicalDependency(final LogicalDependency node,
                                               final PropagationContext context) {
        final BeliefSet beliefSet = ( BeliefSet ) node.getJustified();
        beliefSet.getBeliefSystem().delete( node, beliefSet, context );
    }
View Full Code Here

       
        // "logical" should only appear once
        assertEquals( 1,
                      getLogicalCount( tms ) );
       
        BeliefSet bs =  ( BeliefSet ) logicalHandle2.getEqualityKey().getBeliefSet();      
        assertEquals( "value1", ((LogicalDependency) ((LinkedListEntry)bs.getFirst()).getObject()).getValue() );
        assertEquals( "value2", ((LogicalDependency) ((LinkedListEntry)bs.getFirst().getNext()).getObject()).getValue() );

        // Now lets cancel the first activation
        node2.retractLeftTuple( tuple2,
                                context2,
                                workingMemory );
View Full Code Here

TOP

Related Classes of org.drools.beliefsystem.BeliefSet

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.