//创建Activiti工作流引擎对象 private ProcessEngine processEngine=ProcessEngines.getDefaultProcessEngine(); //部署流程定义 @Test public void deployment() { //获取RepositoryService部署对象 RepositoryService repositoryService=this.processEngine.getRepositoryService(); //BPMN流程 String resourceName="purchasingflow01.bpmn"; InputStream inputStreamBPMN=this.getClass().getClassLoader() .getResourceAsStream("diagram/purchasingflow01.bpmn"); //PNG图片 String resourcePNG="purchasingflow01.png"; InputStream inputStreamPNG=this.getClass().getClassLoader() .getResourceAsStream("diagram/purchasingflow01.png"); Deployment deployment = repositoryService.createDeployment() .addInputStream(resourceName, inputStreamBPMN) .addInputStream(resourcePNG, inputStreamPNG) .deploy(); System.out.println("流程部署ID"+deployment.getId()); }
时间: 2024-12-25 18:11:25