use of org.vcell.sbml.SbmlException in project vcell by virtualcell.
the class SimulationServiceImpl method getSBML.
public String getSBML(String vcml, String applicationName) throws ThriftDataAccessException, TException {
try {
BioModel bioModel = XmlHelper.XMLToBioModel(new XMLSource(vcml));
SimulationContext simContext = bioModel.getSimulationContext(applicationName);
SBMLExporter exporter = new SBMLExporter(simContext, 3, 1, simContext.getGeometry().getDimension() > 0);
VCellSBMLDoc sbmlDoc = exporter.convertToSBML();
return sbmlDoc.xmlString;
} catch (SBMLException | XmlParseException | SbmlException | XMLStreamException e) {
e.printStackTrace();
throw new ThriftDataAccessException("failed to generate SBML document: " + e.getMessage());
}
}
Aggregations