代码如下:
目录结构
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); @Test
public void deploymentProcessEngines(){
InputStream inputStreamBpmn = this.getClass().getResourceAsStream("sequenceFlow.bpmn");
InputStream inputStreamPng = this.getClass().getResourceAsStream("sequenceFlow.png"); Deployment deployment = processEngine.getRepositoryService()
.createDeployment()
.name("流程sequenceFlow")
.addInputStream("sequenceFlow.bpmn", inputStreamBpmn)
.addInputStream("sequenceFlow.png", inputStreamPng)
.deploy(); System.out.println("流程部署id" + deployment.getId()); System.out.println("流程部署name" + deployment.getName());
}
报错信息,原因是因为java默认只编译java文件,需要对所有文件都变异
解决方法,打开当前项目的属性框,将默认只编译java文件的选项删除即可