Skip to content
Snippets Groups Projects
Commit bc7724a9 authored by Sebastian Ebert's avatar Sebastian Ebert
Browse files

working on tina integration

parent ae7be667
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,17 @@ public class ComplexElementsConverter {
pn.setTypeHLAPI(PNType.PTNET);
}
petriNet.getToolspecificList().forEach(toolInfo ->
pn.addToolspecificsHLAPI(new ToolInfoHLAPI(toolInfo.getTool(), toolInfo.getVersion(),
clipToolSpecificsFormattedXmlBuffer(toolInfo.getTool(), toolInfo.getVersion(), toolInfo.getFormattedXMLBuffer()), toolInfo.getToolInfoGrammarURI(), null)));
for(int i = 0; i < petriNet.getNumToolspecific(); i++){
if(petriNet.getToolspecific(i).getFormattedXMLBuffer().indexOf("</toolspecific>") > -1){
pn.addToolspecificsHLAPI(new ToolInfoHLAPI(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(),
clipToolSpecificsFormattedXmlBuffer(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(),
petriNet.getToolspecific(i).getFormattedXMLBuffer()), petriNet.getToolspecific(i).getToolInfoGrammarURI(), null));
}else{
pn.addToolspecificsHLAPI(new ToolInfoHLAPI(petriNet.getToolspecific(i).getTool(), petriNet.getToolspecific(i).getVersion(), petriNet.getToolspecific(i).getFormattedXMLBuffer()
, petriNet.getToolspecific(i).getToolInfoGrammarURI(), null));
}
}
return pn;
......
......@@ -62,7 +62,7 @@ public class PnmlExporter {
try {
PnmlExport pex = new PnmlExport();
pex.exportObject(doc, targetPath);
pex.exportObject(doc, targetPath, true);
} catch (UnhandledNetType | OCLValidationFailed unhandledNetType) {
logger.error("EXCEPTION: " + Arrays.toString(unhandledNetType.getStackTrace()));
hasFailed = true;
......
......@@ -9,7 +9,7 @@ public class PrimitiveElementsConverter {
private static StringBuffer clipToolSpecificsFormattedXmlBuffer(String toolName, String toolVersion, StringBuffer formattedXmlBuffer) {
if (formattedXmlBuffer != null) {
if (formattedXmlBuffer != null && formattedXmlBuffer.indexOf("</toolspecific>") > -1) {
int endCharsLength = 15;
int toolNameLenth = (toolName == null) ? 0 : toolName.length();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment