Search in sources :

Example 1 with StreamSource

use of org.activiti.engine.impl.util.io.StreamSource in project Activiti by Activiti.

the class ImportExportTest method exportAndReadXMLFile.

protected BpmnModel exportAndReadXMLFile(BpmnModel bpmnModel) throws Exception {
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel, processEngineConfiguration.getXmlEncoding());
    StreamSource xmlSource = new InputStreamSource(new ByteArrayInputStream(xml));
    BpmnModel parsedModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return parsedModel;
}
Also used : InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) ByteArrayInputStream(java.io.ByteArrayInputStream) StreamSource(org.activiti.engine.impl.util.io.StreamSource) InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) BpmnXMLConverter(org.activiti.bpmn.converter.BpmnXMLConverter) BpmnModel(org.activiti.bpmn.model.BpmnModel)

Example 2 with StreamSource

use of org.activiti.engine.impl.util.io.StreamSource in project Activiti by Activiti.

the class ImportExportTest method readXMLFile.

protected BpmnModel readXMLFile() throws Exception {
    InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream(getResource());
    StreamSource xmlSource = new InputStreamSource(xmlStream);
    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return bpmnModel;
}
Also used : InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) StreamSource(org.activiti.engine.impl.util.io.StreamSource) InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) BpmnModel(org.activiti.bpmn.model.BpmnModel) BpmnXMLConverter(org.activiti.bpmn.converter.BpmnXMLConverter)

Example 3 with StreamSource

use of org.activiti.engine.impl.util.io.StreamSource in project Activiti by Activiti.

the class CallActivityTest method loadBPMNModel.

protected BpmnModel loadBPMNModel(String bpmnModelFilePath) throws Exception {
    InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream(bpmnModelFilePath);
    StreamSource xmlSource = new InputStreamSource(xmlStream);
    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return bpmnModel;
}
Also used : InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) InputStream(java.io.InputStream) InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) StreamSource(org.activiti.engine.impl.util.io.StreamSource) BpmnModel(org.activiti.bpmn.model.BpmnModel) BpmnXMLConverter(org.activiti.bpmn.converter.BpmnXMLConverter)

Example 4 with StreamSource

use of org.activiti.engine.impl.util.io.StreamSource in project Activiti by Activiti.

the class ChineseConverterTest method exportAndReadXMLFile.

protected BpmnModel exportAndReadXMLFile(BpmnModel bpmnModel) throws Exception {
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel, processEngineConfiguration.getXmlEncoding());
    StreamSource xmlSource = new InputStreamSource(new ByteArrayInputStream(xml));
    BpmnModel parsedModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return parsedModel;
}
Also used : InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) ByteArrayInputStream(java.io.ByteArrayInputStream) StreamSource(org.activiti.engine.impl.util.io.StreamSource) InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) BpmnXMLConverter(org.activiti.bpmn.converter.BpmnXMLConverter) BpmnModel(org.activiti.bpmn.model.BpmnModel)

Example 5 with StreamSource

use of org.activiti.engine.impl.util.io.StreamSource in project Activiti by Activiti.

the class ChineseConverterTest method readXMLFile.

protected BpmnModel readXMLFile() throws Exception {
    InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream(getResource());
    StreamSource xmlSource = new InputStreamSource(xmlStream);
    BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xmlSource, false, false, processEngineConfiguration.getXmlEncoding());
    return bpmnModel;
}
Also used : InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) StreamSource(org.activiti.engine.impl.util.io.StreamSource) InputStreamSource(org.activiti.engine.impl.util.io.InputStreamSource) BpmnModel(org.activiti.bpmn.model.BpmnModel) BpmnXMLConverter(org.activiti.bpmn.converter.BpmnXMLConverter)

Aggregations

BpmnXMLConverter (org.activiti.bpmn.converter.BpmnXMLConverter)5 BpmnModel (org.activiti.bpmn.model.BpmnModel)5 InputStreamSource (org.activiti.engine.impl.util.io.InputStreamSource)5 StreamSource (org.activiti.engine.impl.util.io.StreamSource)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 InputStream (java.io.InputStream)3