【JBPM4】创建流程实例
示例代码:
1 ProcessEngine processEngine = Configuration.getProcessEngine(); 2 ExecutionService executionService = processEngine.getExecutionService(); 3 ProcessInstance processInstance = executionService.startProcessInstanceByKey("test"); 4 System.out.println("流程实例ID=======" + processInstance.getId() );
1、获取流程引擎
2、获取流程执行服务
3、根据流程部署产生的KEY或ID创建并获取流程实例。
KEY值不变,ID格式为KEY值+数字。如test1,test2.