JBPM4 项目发布实例
搭建步骤:
单元测试部分
添加JBPM4和JUnit的Jar包
将sample/src目录下的所有配置文件拷贝到src目录下
//流程发布:
processEngine = new Configuration().buildProcessEngine();
repositoryService = processEngine.getRepositoryService();
executionService = processEngine.getExecutionService();
//将定义的流程配置文件部署到数据库中
deployId = repositoryService.createDeployment()
.addResourceFromClasspath("hello.jpdl.xml")
.deploy();
//启动流程实例
ProcessInstance processInstance = executionService
.startProcessInstanceByKey("hello");
//启动流程后我们的流程会自动进入到state1活动,并处在等待状态
assertTrue(processInstance.isActive("state1"));
String pid = processInstance.getId();
//让state1活动继续往下执行,并进入结束活动,流程结束
processInstance = executionService.signalExecutionById(pid);
assertTrue(processInstance.isEnded());
项目发布原版地址:
http://skyuck.iteye.com/blog/456492