jbpm4入门

public class JbpmTest01 extends TestCase {
   ProcessEngine processEngine;
   public JbpmTest01(){
	   processEngine=Configuration.getProcessEngine();
   }
   //设置一个流程定义,必须要用setUp
   public void setUp(){
	   processEngine.getRepositoryService().createDeployment().addResourceFromClasspath("hellojbpm.jpdl.xml").deploy();
   }
   //获得一个流程定义
   public void testProcessInstance(){
	   ExecutionService executionService=processEngine.getExecutionService();
	   //根据key取到一个流程定义
	   ProcessInstance pi=executionService.startProcessInstanceByKey("hellojbpm");
	   System.out.println("获得当前流程"+pi.getId());
	   System.out.println("该流程是否已经结束"+pi.isEnded());
	   //使得流程向下流转
	   pi=executionService.signalExecutionById(pi.getId());
	   System.out.println("该流程是否已经结束"+pi.isEnded());

   }
   public void testProcessInstanceEnd(){
	   //如果不需要流程继续往下执行,那么可以强制结束
	   ExecutionService executionService=processEngine.getExecutionService();
	   ProcessInstance pi=executionService.startProcessInstanceByKey("hellojbpm");
	   executionService.endProcessInstance(pi.getId(),"jieshu");
   }
}

 eclipse安装文件在\jbpm-4.3\install\src\gpd目录中

配置文件在例程中

你可能感兴趣的:(eclipse,xml,jbpm)