读书人

JBPM4.3调整Spring2.5.6的例子

发布时间: 2012-12-25 16:18:28 作者: rapoo

JBPM4.3整合Spring2.5.6的例子

最近一直在学习JBPM方面的东西,下面是借鉴网上例子完成的JBPM4.3整合Spring2.5.6的DEMO。

JBPM4.3导入到lib包:

??

?Spring结合Jbpm4的测试类

package com.ceopen.appServer;import java.util.List;import org.jbpm.api.ExecutionService;import org.jbpm.api.ProcessDefinition;import org.jbpm.api.ProcessEngine;import org.jbpm.api.ProcessInstance;import org.jbpm.api.RepositoryService;import org.jbpm.api.TaskService;import org.jbpm.api.task.Task;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;public class AppServer {ProcessEngine processEngine;RepositoryService repositoryService;ExecutionService executionService;TaskService taskService;// 部署流程定义public String deployProcDef(String path) {String deploymentId = null;deploymentId = repositoryService.createDeployment().addResourceFromClasspath(path).deploy();return deploymentId;}public void setProcessEngine(ProcessEngine processEngine) {this.processEngine = processEngine;}public void setRepositoryService(RepositoryService repositoryService) {this.repositoryService = repositoryService;}public void setExecutionService(ExecutionService executionService) {this.executionService = executionService;}public void setTaskService(TaskService taskService) {this.taskService = taskService;}public static void main(String[] args) {ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");AppServer appServer = (AppServer) applicationContext.getBean("appServer");appServer.deployProcDef("appServer.jpdl.xml");}}

?其他配置文件见appServer附件,有什么建议或者运行不了的可以一起讨论,呵呵

读书人网 >编程

热点推荐