Activiti 流程发布的调用 repositoryService 的 createDeployment 即可
@Test public void deploy() { Deployment deploy = repositoryService.createDeployment() .addClasspathResource("processes/LeaveProcess.bpmn") .addClasspathResource("processes/LeaveProcess.png") .key(bpmnNameAndKey) .name(bpmnNameAndKey) .category("HR") .deploy(); // 流程部署ID:1 // 流程keyId:LeaveProcess // 流程名称ID:LeaveProcess // 流程分类ID:HR System.out.println("流程部署ID:" + deploy.getId()); System.out.println("流程keyId:" + deploy.getKey()); System.out.println("流程名称ID:" + deploy.getName()); System.out.println("流程分类ID:" + deploy.getCategory()); List<ProcessDefinition> list = repositoryService.createProcessDefinitionQuery() .orderByProcessDefinitionVersion().asc() .list(); if (!CollectionUtils.isEmpty(list)) { for (ProcessDefinition pd : list) { System.out.println("流程Key:" + pd.getKey()); System.out.println("流程名称:" + pd.getName()); System.out.println("流程版本:" + pd.getVersion()); } } }