Examples of retract()


Examples of org.drools.core.StatefulSession.retract()

                      l.size() );
        assertEquals( 2,
                      ((CheeseEqual) l.get( 0 )).getPrice() );

        h = getFactHandle( h, workingMemory );
        workingMemory.retract( h );
        workingMemory = getSerialisedStatefulSession( workingMemory );       
        assertEquals( 0,
                      IteratorToList.convert( workingMemory.iterateObjects() ).size() );

        TruthMaintenanceSystem tms =  ((NamedEntryPoint)workingMemory.getWorkingMemoryEntryPoint( EntryPointId.DEFAULT.getEntryPointId() ) ).getTruthMaintenanceSystem();
View Full Code Here

Examples of org.drools.core.WorkingMemory.retract()

                            result.get( 0 ) );
            }
            i++;
        }

        workingMemory.retract( handle1 );
        results = workingMemory.getQueryResults( "query-1" );

        assertEquals( 1,
                      results.size() );
View Full Code Here

Examples of org.drools.core.WorkingMemory.retract()

        results = workingMemory.getQueryResults( "query-1" );

        assertEquals( 1,
                      results.size() );

        workingMemory.retract( handle2 );
        results = workingMemory.getQueryResults( "query-1" );

        assertEquals( 0,
                      results.size() );
View Full Code Here

Examples of org.drools.core.common.AbstractWorkingMemory.retract()

                     nodes.size());
        assertTrue(nodes.contains(arrayOtn));
        assertTrue(nodes.contains(listOtn));

        // Nodes are there, retract the fact so we can check both nodes are populated
        workingMemory.retract(handle);

        // Add MockSinks so we can track assertions
        final MockObjectSink listSink = new MockObjectSink();
        listOtn.addObjectSink(listSink);
View Full Code Here

Examples of org.drools.core.impl.StatefulKnowledgeSessionImpl.retract()

        // "logical" should only appear once
        assertEquals( 1,
                      getLogicalCount( tms ) );

        // retract the logical prime handle
        ksession.retract( logicalHandle1 );
;

        // The logical object should now disappear appear
        assertEquals( 0,
                      getLogicalCount( tms ) );
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.retract()

                handles.add(securityContext.insert(check));

                securityContext.fireAllRules();
            } finally {
                for (FactHandle handle : handles) {
                    securityContext.retract(handle);
                }
            }
        }

        return check.isGranted();
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.retract()

                handles.add(securityContext.insert(check));

                securityContext.fireAllRules();
            } finally {
                for (FactHandle handle : handles) {
                    securityContext.retract(handle);
                }
            }
        }

        return roleCheck.isGranted();
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.retract()

        int fired = session.fireAllRules();
        assertEquals( 1,
                                 fired );

        session.retract( handle );

        handle = session.insert( new MyObject( "myObj2" ) );

        session.update( handle,
                        new MyObject( "myObj3" ) );
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.retract()

           
        }  
       
        ksession.update( f1, "s1" );
        assertNotNull( ksession.getObject( f1 ) );
        ksession.retract( f1 );
       
        ksession.retract( f1 );
        assertNull( ksession.getObject( f1 ) );
    }
View Full Code Here

Examples of org.drools.runtime.StatefulKnowledgeSession.retract()

       
        ksession.update( f1, "s1" );
        assertNotNull( ksession.getObject( f1 ) );
        ksession.retract( f1 );
       
        ksession.retract( f1 );
        assertNull( ksession.getObject( f1 ) );
    }

    private static class ReentrantAction implements WorkingMemoryAction {
        // I am using AtomicInteger just as an int wrapper... nothing to do with concurrency here
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.