Package org.drools

Examples of org.drools.StatefulSession.halt()


        }).start();
   
        Thread.sleep(100);

        assertEquals(0, session2.getProcessInstances().size());
        session2.halt();
    }
   
    private static class TestWorkItemHandler implements WorkItemHandler {
      private WorkItem workItem;
      public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
View Full Code Here


        workingMemory.fireAllRules();
       
        assertEquals( 1,
                      list.size() );
       
        workingMemory.halt();
    }

    public void testRuleFlow() throws Exception {
        final PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.drl" ) ) );
View Full Code Here

        workingMemory.getAgenda().activateRuleFlowGroup( "Group1" );
        workingMemory.fireAllRules();

        assertEquals( 1, list.size() );

        workingMemory.halt();
    }

    @Test
    public void testDateEffective() throws Exception {
        // read in the source
View Full Code Here

        try {
      Thread.sleep(2000);
    } catch (InterruptedException e) {
    }
        assertEquals(4, list.size());
        workingMemory.halt();
    }
   
}
View Full Code Here

        workingMemory.fireAllRules();

        assertEquals( 1,
                      list.size() );

        workingMemory.halt();
    }

    private RuleBase loadRuleBase( final Reader reader ) throws IOException,
                                                        DroolsParserException,
                                                        Exception {
View Full Code Here

        workingMemory.getAgenda().activateRuleFlowGroup( "Group1" );
        workingMemory.fireAllRules();

        assertEquals( 1, list.size() );

        workingMemory.halt();
    }

    @Test
    public void testDateEffective() throws Exception {
        // read in the source
View Full Code Here

        workingMemory.fireAllRules();

        assertEquals( 1,
                      list.size() );

        workingMemory.halt();
    }

    @Test
    public void testDateEffective() throws Exception {
        // read in the source
View Full Code Here

        Thread.sleep(1000);
       
        assertEquals( 1,
                      list.size() );
       
        workingMemory.halt();
    }

    public void testRuleFlow() throws Exception {
        final PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.drl" ) ) );
View Full Code Here

        Thread.sleep(1000);
       
        assertEquals( 1,
                      list.size() );
       
        workingMemory.halt();
    }

    public void testRuleFlow() throws Exception {
        final PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.drl" ) ) );
View Full Code Here

        }).start();
   
        session.startProcess("com.sample.ruleflow", null);

        assertEquals(1, session.getProcessInstances().size());
        session.halt();
       
        final StatefulSession session2 = getSerialisedStatefulSession( session );
       
    new Thread(new Runnable() {
      public void run() {
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.