首页 > 其他 > 详细

activiti7根据xml字符串进行流程部署

时间:2020-07-30 00:20:38      阅读:339      评论:0      收藏:0      [点我收藏+]

try {
//获取流程XML
XMLInputFactory factory = XMLInputFactory.newFactory();
Reader reader = new StringReader(‘xml 字符串‘);
XMLStreamReader streamReader = factory.createXMLStreamReader(reader);
BpmnXMLConverter converter = new BpmnXMLConverter();
BpmnModel bpmnModel = converter.convertToBpmnModel(streamReader);


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

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

//3.进行部署
Deployment deployment = repositoryService.createDeployment()//创建Deployment对象
.name(‘name‘)
.key(‘key‘)
.category(‘category‘)
            .tenantId("000000")
.addBpmnModel(’bpmn name‘, bpmnModel)
.deploy();//部署
log.info("name---" + deployment.getName());
} catch (Exception e) {
e.printStackTrace();
}

activiti7根据xml字符串进行流程部署

原文:https://www.cnblogs.com/ggdxx/p/13400029.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!