Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Code for Model created in Sirius editor (JAVA CODE FOR MODEL IN SIRIUS EDITOR)
Code for Model created in Sirius editor [message #1815121] Wed, 25 September 2019 16:23 Go to next message
yawar rasheed is currently offline yawar rasheedFriend
Messages: 8
Registered: September 2019
Junior Member
Hi ..
Iam new to sirius and eclipse and need an urgent guidance.
i have created a DSL and then in new run time configuration..i am able to create sytem model using the concepts of meta model. Thereafter i graphically represented the system model using sirius editor and also developed a palette from where i can drag drop the model elements. The problem which iam facing now is :
From where can i find the java code for my system model (which is there in graphical form in sirius editor). Is it automatically generated or we have to generate it ourself.
Thanking in anticipation. REGARDS...
Re: Code for Model created in Sirius editor [message #1815132 is a reply to message #1815121] Wed, 25 September 2019 19:22 Go to previous messageGo to next message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 123
Registered: February 2018
Senior Member
Hi,

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 [1].

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:

  1. Generate the Java code from your metamodel [1],
  2. 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. [4] shows how to create a new model file and [5] shows how to create a new Sirius representation from a model file.

Once you have determined the model file, [6] shows how you can turn it into a Java instance.

Hope that helps.

Regards,
Emmanuel

[1] https://www.vogella.com/tutorials/EclipseEMF/article.html#generating-java-code
[2] https://www.eclipse.org/forums/index.php/t/1100409/
[3] https://www.eclipse.org/forums/index.php/t/1100361/
[4] https://www.vogella.com/tutorials/EclipseEMF/article.html#create-your-model
[5] https://wiki.eclipse.org/Sirius/Tutorials/StarterTutorial#Via_the_Model_Explorer
[6] https://www.vogella.com/tutorials/EclipseEMF/article.html#load-an-existing-model

[Updated on: Wed, 25 September 2019 20:00]

Report message to a moderator

Re: Code for Model created in Sirius editor [message #1828885 is a reply to message #1815132] Sun, 21 June 2020 11:33 Go to previous message
Sel ma is currently offline Sel maFriend
Messages: 16
Registered: June 2020
Junior Member
Hi Yawar and Emmanuel,

I have the same concern as Yawar and it's urgent !

@Emmanuel, mine is the point (b): I want to generate Java code from the model defined with my Sirius editor and I am using Accelo _as you said I should write the generator y myself. I got confused on how to start the code generation of my sriuis model, from where to start and the steps to follow in order to generate the code of the Sirius model.

Can you guys guide me on how to start the code generation using Accelo ?

Best regards.
Previous Topic:Merging two Sirius models
Next Topic:[ANN] Sirius 6.3.1
Goto Forum:
  


Current Time: Fri Apr 19 21:38:58 GMT 2024

Powered by FUDForum. Page generated in 0.02847 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top