/** Work in progress for testing conditions. */ public <T extends Condition> T readCondition(String xml, Class<T> conditionClass) { XmlElement xmlRoot = XmlReader.parseXml(new StringReader(xml)); if (xmlRoot != null && xmlRoot.elements != null) { try { T condition = conditionClass.newInstance(); BpmnReaderImpl reader = new BpmnReaderImpl(bpmnMappings, jsonStreamMapper); reader.currentXml = xmlRoot; condition.readBpmn(reader); return condition; } catch (Exception e) { throw new RuntimeException("Could not read condition: " + e.getMessage(), e); } } else { return null; } }
public AbstractWorkflow readFromReader(Reader reader) { XmlElement xmlRoot = XmlReader.parseXml(reader); return new BpmnReaderImpl(bpmnMappings, jsonStreamMapper).readDefinitions(xmlRoot); }