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: 7
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 message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 66
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 [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.



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

Report message to a moderator

Previous Topic:Code for Model created in Sirius editor
Next Topic:Viewpoint referencing event
Goto Forum:

Current Time: Mon Feb 17 07:50:32 GMT 2020

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

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

Back to the top