官方提供的userguide从大的方面阐述了jBPM的基本流程和概念,总结一下其思路:
一:发布
1.一切从Configuration开始:Configuration configuration = new Configuration();
2.然后构建 ProcessEngine:ProcessEngine processEngine = configuration().buildProcessEngine();
3.有了ProcessEngine,一切就都有了:
RepositoryService repositoryService = processEngine.getRepositoryService();
ExecutionService executionService = processEngine.getExecutionService();
TaskService taskService = processEngine.getTaskService();
HistoryService historyService = processEngine.getHistoryService();
ManagementService = processEngine.getManagementService();
4.发布了:String deploymentId = repositoryService.createDeployment()
.addResourceFromClassPath("org/jbpm/Order.jpdl.xml")
.deploy();
5.现在删除它吧:repositoryService.deleteDeployment(deploymentId);
当然,还有另一个方法:repositoryService.deleteDeploymentCascade(deploymentId);//将删除相关instance和history。