activiti7 读取bpmn文件部署流程


try {
//获取文件流
File fileBpmn = new File('bpmn文件绝对地址');
InputStream BpmnInputStream = null;
try {
BpmnInputStream = new FileInputStream(fileBpmn);
} catch (IOException e) {

}
File fileSvg = new File('png/svg 文件绝对地址');
InputStream SvgInputStream = null;
try {
SvgInputStream = new FileInputStream(fileSvg);
} catch (IOException e) {

}
//1.创建ProcessEngine对象
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

//2.得到RepositoryService实例
RepositoryService repositoryService = processEngine.getRepositoryService();


//3.进行部署
Deployment deployment = repositoryService.createDeployment()//创建Deployment对象
.name('name')
.key('')
.category('')
.tenantId("000000")
.addInputStream(fileBpmn.getName(), BpmnInputStream)//添加bpmn文件
.addInputStream(fileSvg.getName(), SvgInputStream)//添加png/svg文件
.deploy();//部署
log.info("name---" + deployment.getName());
} catch (Exception e) {
e.printStackTrace();
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM