Closed wasowski closed 4 years ago
First of all, there is no translation between EMF and NMF on the instance level because there, the representation is the same, namely that EMF-flavored XMI representation that allows index- or name-based references inside and across files without having to refer to XMI IDs.
For your actual problem: My first guess is that you are indeed missing the metamodel Registration. In NMF, you don't do that via a method call but rather through an assembly-level annotation like here: https://github.com/NMFCode/NMF/blob/master/Models/Models.Tests/Properties/AssemblyInfo.cs#L39
For this, you will also need to include the (NMeta) metamodel as embedded resource and provide the name there. You can have Ecore2Code generate it for you by specifying the -m Option with a path to where it should be stored.
OK. This makes sense. Obviously my .NET incompetence is shining here. I did not even know where to search. This example was really helpful. I managed to load the first instance. It should be downhill from here. Thanks!
(possibly related to issue #55)
Hi, Apologies to bother you again. Unfortunately, I have run into another problem. Issue #55 seems to be related, giving some hope. I am loading an instance of the Ecore meta-model created in EMF. This is the instance I am loading:
(The metamodel is here: https://bitbucket.org/itu-square/mdsebook/src/master/mdsebook.fsm/model/fsm.ecore - almost the same meta-model that you are using in your examples.)
I am trying to load it with something like
This compiles, but loading fails at runtime with the following message:
I have been unable to understand what is wrong. My guess was that the meta-model is not loading, but I cannot load the meta-model either, and the other examples do not explicitly load meta-models.
Any ideas? I appreciate any suggestions.
Alternatively: if there is no easy way to solve it, is there a way to translate Ecore instances to NFM instances? I figured that I can translate the meta-model with ecore2code, but have not figured out how to translate the instances.