2
Activiti7实战笔记
source link: https://segmentfault.com/a/1190000038547236
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、Activiti流程部署
当定义好流程之后,第一步就是要进行流程的部署操作,主要是采取读取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 二进制数据表
- act_re_deployment 部署信息表
- act_re_procdef 流程定义数据表
act_ge_bytearray 表:
字段 DEPLOYMENT_ID_
关联 act_re_deployment
表的 ID_
字段。
act_re_deployment 表:
act_re_procdef 表:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK