工作流-解析bpmn

@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分类目录

猜你喜欢

转载自www.cnblogs.com/1994july/p/12384505.html