Package org.jbpm.graph.exe

Examples of org.jbpm.graph.exe.ProcessInstance


      "</process-definition>"
    );
   
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    try {
      processInstance.signal();
      processInstance.suspend();
      jbpmContext.save(processInstance);
    } finally {
      jbpmContext.close();
    }

    assertEquals(1, testSchedulerService.suspendedTimerTokens.size());
    Token suspendedToken = (Token) testSchedulerService.suspendedTimerTokens.get(0);
    assertSame(processInstance.getRootToken(), suspendedToken);

    jbpmContext = jbpmConfiguration.createJbpmContext();
    testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
    try {
      processInstance.resume();
      jbpmContext.save(processInstance);
    } finally {
      jbpmContext.close();
    }

    Token resumedToken = (Token) testSchedulerService.resumedTimerTokens.get(0);
    assertSame(processInstance.getRootToken(), resumedToken);
  }
View Full Code Here


      "  </state>" +
      "</process-definition>"
    );
   
    try {
      new ProcessInstance(processDefinition).signal();
      fail("expected exception");
    } catch (JbpmException e) {
      // OK
    }
  }
View Full Code Here

    );
   
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      TestSchedulerService testSchedulerService = (TestSchedulerService) jbpmContext.getServices().getSchedulerService();
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      processInstance.signal();
     
      List scheduledTimers = testSchedulerService.createdTimers;
      assertEquals(1, scheduledTimers.size());

    } finally {
View Full Code Here

      "</process-definition>"
    );
   
    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    try {
      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      processInstance.signal();
      assertTrue(isCustomized);

    } finally {
      jbpmContext.close();
    }
View Full Code Here

      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
   
    TaskMgmtInstance taskMgmtInstance =processInstance.getTaskMgmtInstance();
    TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next();
   
    assertEquals("johndoe", changeNappy.getActorId());
    assertNull(changeNappy.getPooledActors());
  }
View Full Code Here

      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
   
    TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
    TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next();
   
    Set expectedActorIds = new HashSet( Arrays.asList(new Object[]{"me", "you", "them"}) );
   
    // collect actor ids from the task instances
View Full Code Here

      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
   
    TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
    assertEquals(1, taskMgmtInstance.getTaskInstances().size());
    TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next();
    assertNull(changeNappy.getActorId());
    assertNull(changeNappy.getPooledActors());
  }
View Full Code Here

      "  </start-state>" +
      "  <state name='wait' />" +
      "</process-definition>"
    );

    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();

    JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
    jbpmContext.setActorId("cookie monster");
    try {
      taskMgmtInstance.createStartTaskInstance().end();
View Full Code Here

      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
    TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
    assertEquals(1, taskMgmtInstance.getTaskInstances().size());
    TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next();
    assertEquals("me", changeNappy.getActorId());
    assertNull(changeNappy.getPooledActors());
  }
View Full Code Here

      "    </task>" +
      "  </task-node>" +
      "</process-definition>"
    );
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
    TaskMgmtInstance taskMgmtInstance = processInstance.getTaskMgmtInstance();
    assertEquals(1, taskMgmtInstance.getTaskInstances().size());
    TaskInstance changeNappy = (TaskInstance) taskMgmtInstance.getTaskInstances().iterator().next();
    assertNull(changeNappy.getActorId());
   
    Set expectedPooledActors = new HashSet();
View Full Code Here

TOP

Related Classes of org.jbpm.graph.exe.ProcessInstance

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.