public DesignProcessDefinition convertXmlToProcess(String content) throws IOException { try (InputStream stream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))) { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller .setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(this.getClass().getResource("/ProcessDefinition.xsd"))); DesignProcessDefinition process = (DesignProcessDefinition) unmarshaller.unmarshal(stream); if (process.getActorInitiator() != null) { process.getActorInitiator().setInitiator(true); } addEventTriggerOnEvents(process.getFlowElementContainer()); return process; } catch (java.lang.UnsupportedOperationException | JAXBException | SAXException e) { throw new IOException("Failed to deserialize the XML string provided", e); } }
public DesignProcessDefinition convertXmlToProcess(String content) throws IOException { try (InputStream stream = new ByteArrayInputStream(content.getBytes(StandardCharsets.UTF_8))) { Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller .setSchema(SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI).newSchema(this.getClass().getResource("/ProcessDefinition.xsd"))); DesignProcessDefinition process = (DesignProcessDefinition) unmarshaller.unmarshal(stream); if (process.getActorInitiator() != null) { process.getActorInitiator().setInitiator(true); } addEventTriggerOnEvents(process.getFlowElementContainer()); return process; } catch (java.lang.UnsupportedOperationException | JAXBException | SAXException e) { throw new IOException("Failed to deserialize the XML string provided", e); } }