⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defaultconfigurationtest.java

📁 jBpm是一个灵活可扩展的工作流管理系统。作为jBpm运行时server输入的业务流程使用简单强大的语言表达并打包在流程档案中
💻 JAVA
字号:
package org.jbpm;

import junit.framework.TestCase;

import org.apache.log4j.BasicConfigurator;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;

public class DefaultConfigurationTest extends TestCase {
  
  /*
   * This test needs to be executed without src/config.files or any other 
   * configuration files in the classpath.
   * 
   * Only following libs should be in the classpath:
   *  - jbpm
   *  - commons-logging
   *  - dom4j
   *  - junit
   */
  
  static {
    BasicConfigurator.configure();
  }

  public void testDefaultConfiguration() {
    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
      "<process-definition>" +
      "  <start-state name='start'>" +
      "    <transition to='one' />" +
      "  </start-state>" +
      "  <state name='one'>" +
      "    <transition to='two' />" +
      "  </state>" +
      "  <state name='two'>" +
      "    <transition to='three' />" +
      "  </state>" +
      "  <state name='three'>" +
      "    <transition to='end' />" +
      "  </state>" +
      "  <end-state name='end' />" +
      "</process-definition>"
    );
    
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    assertEquals("start", processInstance.getRootToken().getNode().getName());
    processInstance.signal();
    assertEquals("one", processInstance.getRootToken().getNode().getName());
    processInstance.signal();
    assertEquals("two", processInstance.getRootToken().getNode().getName());
    processInstance.signal();
    assertEquals("three", processInstance.getRootToken().getNode().getName());
    processInstance.signal();
    assertTrue(processInstance.hasEnded());
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -