码迷,mamicode.com
首页 > 其他好文 > 详细

工作流-解析bpmn

时间:2020-02-29 18:44:12      阅读:76      评论:0      收藏:0      [点我收藏+]

标签:com   cti   对象   文件   cto   ade   set   nbsp   create   

@SneakyThrows
public void add(FlowModelAdd param, MultipartFile file){
	byte[] bytes = file.getBytes();
	String xml = new String(bytes, StandardCharsets.UTF_8);

	//创建转换对象
	BpmnXMLConverter converter = new BpmnXMLConverter();
	XMLInputFactory factory = XMLInputFactory.newInstance();
	// 字节方式
	XMLStreamReader reader = factory.createXMLStreamReader(new ByteArrayInputStream(xml.getBytes()));
	// 流方式
	XMLStreamReader reader = factory.createXMLStreamReader(file.getInputStream());

	//将xml文件转换成BpmnModel
	BpmnModel bpmnModel = converter.convertToBpmnModel(reader);
	System.out.println(bpmnModel);
}
 来源:35分类目录

工作流-解析bpmn

标签:com   cti   对象   文件   cto   ade   set   nbsp   create   

原文地址:https://www.cnblogs.com/1994july/p/12384505.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!