Currently, there is a bug in the SmartEMF implementation that breaks the model saving functionality:
Exception in thread "main" java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at org.emoflon.smartemf.persistence.XmiParserUtil.pathOfProjectInWorkspace(XmiParserUtil.java:139)
at org.emoflon.smartemf.persistence.XmiParserUtil.resolveURIToPath(XmiParserUtil.java:64)
at org.emoflon.smartemf.persistence.SmartEMFResource.save(SmartEMFResource.java:72)
Code:
final ResourceSet rs = new ResourceSetImpl();
// SmartEMF
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi",
new SmartEMFResourceFactoryImpl(System.getenv("WORKSPACE")));
final Resource r = rs.createResource(URI.createFileURI(path));
// Fetch model contents from eMoflon
r.getContents().add(root);
try {
r.save(null);
} catch (final IOException e) {
e.printStackTrace();
}
This behaviour only occurs if there is no XMI file before running the code. Current workaround: $ touch model.xmi
Currently, there is a bug in the SmartEMF implementation that breaks the model saving functionality:
Code:
This behaviour only occurs if there is no XMI file before running the code. Current workaround:
$ touch model.xmi