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