Examples of halt()


Examples of org.drools.StatefulSession.halt()

        }).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

Examples of org.drools.StatefulSession.halt()

   
        Thread.sleep(400);

        assertEquals(0, session2.getProcessInstances().size());
       
        session2.halt();
    }
   
    public void test6() throws Exception {
        String process =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here

Examples of org.drools.StatefulSession.halt()

    

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        marshaller.marshall( baos, ksession );
        byte[] b1 = baos.toByteArray();
        session.halt();
        session.dispose();
        Thread.sleep(400);
       
        ByteArrayInputStream bais = new ByteArrayInputStream( b1 );       
        final StatefulSession session2 = ( StatefulSession ) (( StatefulKnowledgeSessionImpl) marshaller.unmarshall( bais ) ).session;
View Full Code Here

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

Examples of org.drools.StatefulSession.halt()

        ProcessInstance processInstance = ( ProcessInstance )
          session.startProcess("org.drools.timer");
        assertEquals(0, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals(1, ((InternalProcessRuntime) ((InternalWorkingMemory) session).getProcessRuntime()).getTimerManager().getTimers().size());
        session.halt();
       
        final StatefulSession session2 = getSerialisedStatefulSession( session );
        myList = (List<Message>) session2.getGlobal( "myList" );
    new Thread(new Runnable() {
      public void run() {
View Full Code Here

Examples of org.drools.StatefulSession.halt()

          // do nothing
        }
        assertEquals(5, myList.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
       
        session2.halt();
  }
 
  @SuppressWarnings("unchecked")
  public void testVariableSimpleProcess() throws Exception {
    PackageBuilder builder = new PackageBuilder();
View Full Code Here

Examples of org.drools.StatefulSession.halt()

        ProcessInstance processInstance = ( ProcessInstance )
          session.startProcess("org.drools.timer", params);
        assertEquals(0, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals(1, ((InternalProcessRuntime) ((InternalWorkingMemory) session).getProcessRuntime()).getTimerManager().getTimers().size());
        session.halt();
       
        final StatefulSession session2 = getSerialisedStatefulSession( session );
        myList = (List<Message>) session2.getGlobal( "myList" );
    new Thread(new Runnable() {
      public void run() {
View Full Code Here

Examples of org.drools.StatefulSession.halt()

          // do nothing
        }
        assertEquals(5, myList.size());
        assertEquals(ProcessInstance.STATE_COMPLETED, processInstance.getState());
       
        session2.halt();
  }
 
  public void testIncorrectTimerNode() throws Exception {
    PackageBuilder builder = new PackageBuilder();
    Reader source = new StringReader(
View Full Code Here

Examples of org.drools.StatefulSession.halt()

          session.startProcess("org.drools.timer");
        assertEquals(0, myList.size());
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
        assertEquals(1, ((InternalProcessRuntime) ((InternalWorkingMemory) session).getProcessRuntime()).getTimerManager().getTimers().size());
       
        session.halt();
       
        final StatefulSession session2 = getSerialisedStatefulSession( session );
        myList = (List<String>) session2.getGlobal( "myList" );
       
    new Thread(new Runnable() {
View Full Code Here

Examples of org.drools.StatefulSession.halt()

        } catch (InterruptedException e) {
            // do nothing
        }
        assertEquals(1, myList.size());
       
        session2.halt();
  }

  @SuppressWarnings("unchecked")
  public void testOnEntryTimerVariableExecuted() throws Exception {
    PackageBuilder builder = new PackageBuilder();
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.