当定义好流程之后,第一步就是要进行流程的部署操作,主要是采取读取bpmn资源文件的方法。
上传的流程定义:
查看流程图详情:
@Override public void uploadStreamAndDeployment(MultipartFile file) throws IOException { // 获取上传的文件名 String fileName = file.getOriginalFilename(); // 获取输入流(字节流)对象 InputStream fileInputStream = file.getInputStream(); // 获取扩展名 String extension = FilenameUtils.getExtension(fileName); // 初始化流程 if(extension.equals("zip")) { ZipInputStream zipInputStream = new ZipInputStream(fileInputStream); repositoryService.createDeployment() .addZipInputStream(zipInputStream) .deploy(); }else{ repositoryService.createDeployment() .addInputStream(fileName, fileInputStream) .deploy(); } }
流程部署涉及到主要的三张表:
act_ge_bytearray 表:
字段 DEPLOYMENT_ID_
关联 act_re_deployment
表的 ID_
字段。
act_re_deployment 表:
act_re_procdef 表: