Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » create an odesign file programmatically
create an odesign file programmatically [message #1754078] Tue, 14 February 2017 12:11 Go to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Hi all,

How can I create an odesign file programmatically using java?
Does exist such code and/or doc to follow?

best regards,

Faiez
Re: create an odesign file programmatically [message #1754098 is a reply to message #1754078] Tue, 14 February 2017 13:57 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi,

Do you want just create an odesign file as when you do "new Viewpoint Specification Model" or do you want "peuplate" the odesign?

Regards,

[Updated on: Tue, 14 February 2017 13:58]

Report message to a moderator

Re: create an odesign file programmatically [message #1754313 is a reply to message #1754098] Thu, 16 February 2017 10:19 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
I want to generate the odesign model from a model transformation.
So I want to (1) create it programmatically with java like any model conform to an EMF metamodel (http://www.vogella.com/tutorials/EclipseEMFPersistence/article.html#example)
and also to (2) add elements ("peuplate") into as it is an output of a model transformation.
Re: create an odesign file programmatically [message #1754582 is a reply to message #1754313] Mon, 20 February 2017 14:32 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Faiez,

If you open an existing Viewpoint Specification Model and select any VSM element, you will have the "Show type" action in the contextual menu. If you enabled it, it will display the EClass of each element of the VSM at the beginning of their label (see first attachement).

Then you can also use the Acceleo Interpreter view (configured as Sirius Interpreter) to do some requests in AQL to check some values or properties of the selected element.

With these info and the Sirius metamodels and their factories, you should be able to programmatically populate your VSM models as any other EMF models. Just pay attention to some attributes/references which can have different names between the VSM editor and the model definition (see properties files in metamodels plugins)

You will find metamodels and factories here:
- Core: org.eclipse.sirius/model/viewpoint.ecore
- org.eclipse.sirius.viewpoint.description.DescriptionFactory.eINSTANCE
- Diagram: org.eclipse.sirius.diagram/model/diagram.ecore
-org.eclipse.sirius.diagram.description.DescriptionFactory.eINSTANCE
- Sequence: org.eclipse.sirius.diagram.sequence/model/sequence.ecore
-org.eclipse.sirius.diagram.sequence.description.DescriptionFactory.eINSTANCE
- Table: org.eclipse.sirius.table/model/table.ecore
- org.eclipse.sirius.table.metamodel.table.description.DescriptionFactory.eINSTANCE
- Tree: org.eclipse.sirius.tree/model/tree.ecore
- org.eclipse.sirius.tree.description.DescriptionFactory.eINSTANCE
- Properties: org.eclipse.sirius.properties/model/properties.ecore
- org.eclipse.sirius.properties.PropertiesFactory.eINSTANCE


For the creation of the files, you might take a look to : org.eclipse.sirius.editor.tools.internal.wizards.ViewpointSpecificationProjectWizard.performFinish()

Regards






  • Attachment: showTypes.png
    (Size: 78.17KB, Downloaded 125 times)
Previous Topic:Java Service doesn't return anything
Next Topic:Get the representations.aird file path
Goto Forum:
  


Current Time: Fri Apr 26 16:22:31 GMT 2024

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

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

Back to the top