当前位置:文库下载 > 所有分类 > IT/计算机 > jBPM的基本流程和概念(学习笔记)
免费下载此文档侵权投诉

jBPM的基本流程和概念(学习笔记)

jBPM的基本流程和概念 2010-07-07 14:06:16
标签:概念 流程 jBPM
官方提供的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。
Obtain ProcessEngine from a Configuration:
ProcessEngine processEngine = new Configuration().buildProcessEngine();
those code will load this default configuration file jbpm.cfg.xml which is expected in the root of the classpath.
Get ProcessEngine from your own configuration file by Configuration:
ProcessEngine processEngine = new Configuration().setResource("myconfigurationfile.xml").bulidProcessEngine();
Now you can obtain the following services:
RepositoryService repositoryService = processEngine.getRepositoryService();
ExecutionService executionService = processEngine.getExecutionService();
TaskService taskService = processEngine.getTaskService();
HistoryService historyService = processEngine.getHistoryService();
ManagementService managementService = processEngine.getManagementService();
Deploying a process:
String deploymentId = repositoryService.createDeployment().addResourceFromClassPath("org/jbpm/my.jpdl.xml").deploy();
Deleting a deployment:
repositoryService.deleteDeployment(deploymentId);
repositoryService.deleteDeploymentCascade(deploymentId);


Starting a new process instance
Simplest and most common way:
ProcessInstance processInstance = executionService.startProcessInstanceByKey("ICL");
Specific process version:
ProcessInstanc processInstance = executionService.startProcessInstanceById("ICL-1");
With a key:
ProcessInstance processInstance = executionService.startProcessInstanceByKey("ICL","CL92837");
With variables:
Map<String,Object> variables = new HashMap<String,Object>();
variables.put("customer",&qu


ot;John Doe");
variables.put("type","Accident");
ProcessInstance processInstance = executionService.startProcessInsta

第1页

免费下载Word文档免费下载:jBPM的基本流程和概念(学习笔记)

(下载1-2页,共2页)

我要评论

返回顶部