|Re: Code for Model created in Sirius editor [message #1815132 is a reply to message #1815121]
||Wed, 25 September 2019 19:22
| Emmanuel Chebbi
Registered: February 2018
I am not sure about what you are trying to achieve.
a) If you want the Java code corresponding to the concepts defined in your metamodel you can generate it from your .genmodel file .
b) If you want to generate some code (Java, XML, JSON or whatever suits your needs) from the model defined with your Sirius editor then you'll have to write the generator yourself [2, 3].
c) If you want to manipulate Java instances that correspond to the model defined with your Sirius editor, then you have to:
- Generate the Java code from your metamodel ,
- Load your model from the file in which it is stored.
Regarding this "model file". When you use the Sirius editor to edit your system model you should notice that your project contains at least two files:
- a representations.aird file, which is used by Sirius to store informations about how your model is shown. In other words, this file does not contain any information about your model itself, just data about how the diagram should be displayed,
- a model file, which actually defines the content of your model. Usually the extension of this file is the name of your metamodel. For instance, if you have a file named system.ecore then it's likely that the model file will be called something.system. Otherwise, I believe that the xmi extension is used by default.  shows how to create a new model file and  shows how to create a new Sirius representation from a model file.
Once you have determined the model file,  shows how you can turn it into a Java instance.
Hope that helps.
[Updated on: Wed, 25 September 2019 20:00]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01941 seconds