Package org.jbpm.scheduler.exe

Source Code of org.jbpm.scheduler.exe.SchedulerAndAsyncDbTest

package org.jbpm.scheduler.exe;

import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.scheduler.impl.SchedulerThread;

public class SchedulerAndAsyncDbTest extends AbstractDbTestCase {

  public void testTimerInCombinationWithAsyncNode() throws Exception {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state name='start'>" +
      "    <transition to='timed'/>" +
      "  </start-state>" +
      "  <state name='timed'>" +
      "    <timer name='reminder' " +
      "           duedate='0 seconds' " +
//      "           repeat='10 business minutes'" +
      "           transition='timer fires' />" +
      "    <transition name='timer fires' to='async'/>" +
      "    <transition name='normal continuation' to='end'/>" +
      "  </state>" +
      "  <node name='async' async='true'>" +
      "    <transition to='timed'/>" +
      "  </node>" +
      "  <end-state name='end' />" +
      "</process-definition>"
    );
    processDefinition = saveAndReload(processDefinition);
   
    // create the process instance
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    processInstance.signal();
    jbpmContext.save(processInstance);
   
    commitAndCloseSession();
   
    SchedulerThread schedulerThread = new SchedulerThread(jbpmConfiguration);
    schedulerThread.executeTimers();
   
    beginSessionTransaction();
  }
}
TOP

Related Classes of org.jbpm.scheduler.exe.SchedulerAndAsyncDbTest

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.