Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [SOLVED] Select Viewpoint doesn't show when using XText metamodel/grammar
[SOLVED] Select Viewpoint doesn't show when using XText metamodel/grammar [message #1726375] Fri, 11 March 2016 23:35 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,

I have a design file (let's say myDesign.odesign) and an Ecore metamodel. My Ecore is generated by creating an ECore project. These two work fine. However, I need to change my Ecore meta model with XText grammar and the metamodel that is now generated with XText. When I create the modeling project and create my xtext instance file, and then select viewpoint, it doesn't show the viewpoint I designed so that I can select it !

I don't know how to make it work when using XText metamodel. I know it is possible since "Sirius Xtext Integration" example is doing the same.

Thanks,
Bests,
Parsa

[Updated on: Fri, 01 April 2016 16:16]

Report message to a moderator

Re: Select Viewpoint doesn't show when using XText metamodel/grammar [message #1726640 is a reply to message #1726375] Tue, 15 March 2016 10:40 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Parsa,

A Viewpoint is selectable if you Modeling Project contains a semantic
resource with the file extension for which you have defined the
Viewpoint in your odesign. Do you have changed this file extension?

Note that with Xtext you can generate a default grammar from an existing
..ecore instead of doing a .ecore from a grammar.

Best Regards.

Le 12/03/2016 00:35, Parsa Pourali a écrit :
> Hi,
>
> I have a design file (let's say myDesign.odesign) and an Ecore
> metamodel. My Ecore is generated by creating an ECore project. These
> two work fine. However, I need to change my Ecore meta model with XText
> grammar and the metamodel that is now generated with XText. When I
> create the modeling project and create my xtext instance file, and then
> select viewpoint, it doesn't show the viewpoint I designed so that I can
> select it !
>
> I don't know how to make it work when using XText metamodel. I know it
> is possible since "Sirius Xtext Integration" example is doing the same.
>
> Thanks,
> Bests,
> Parsa



--
Esteban Dugueperoux - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Select Viewpoint doesn't show when using XText metamodel/grammar [message #1726826 is a reply to message #1726640] Wed, 16 March 2016 17:10 Go to previous messageGo to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi Esteban,

Thanks for you comment. I actually created a file with the right extension but it didn't work ! My files have the extension of "forml". In the odesign the model file extension was "*", it didn't work ! I changed it to "forml", again it didn't work ! The only time it works is that I add the model file as project dependency (right click on Project Dependency -> Add Model) in the modelling project.

It is weird as it works really good with EMF projects but not with xtext projects. Should I generate edit or editor from Genmodel ?

Thanks,
Parsa
Re: Select Viewpoint doesn't show when using XText metamodel/grammar [message #1726872 is a reply to message #1726826] Thu, 17 March 2016 08:13 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi,

Indeed it is normal because only XMIResource are automatically added as
semantic resources to a Sirius session.
Technically this is managed by
org.eclipse.sirius.business.api.resource.LoadEMFResource class.

Best Regards.

Le 16/03/2016 18:10, Parsa Pourali a écrit :
> Hi Esteban,
>
> Thanks for you comment. I actually created a file with the right
> extension but it didn't work ! My files have the extension of "forml".
> In the odesign the model file extension was "*", it didn't work ! I
> changed it to "forml", again it didn't work ! The only time it works is
> that I add the model file as project dependency (right click on Project
> Dependency -> Add Model) in the modelling project.
>
> It is weird as it works really good with EMF projects but not with xtext
> projects. Should I generate edit or editor from Genmodel ?
>
> Thanks,
> Parsa



--
Esteban Dugueperoux - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Select Viewpoint doesn't show when using XText metamodel/grammar [message #1726984 is a reply to message #1726872] Fri, 18 March 2016 01:00 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
OK, I see,

I found that another solution would be changing the Xtext grammar, assuming System is the root of your grammar:
System:
	((worldmodel=WorldModel)? & (behaviourmodel=BehaviourModel)?);

should be changed to
System:
	{System} //create action
	((worldmodel=WorldModel)? & (behaviourmodel=BehaviourModel)?);

Thanks a lot !
Parsa

[Updated on: Fri, 01 April 2016 16:15]

Report message to a moderator

Previous Topic:Reuse of models
Next Topic:Diagram extensions hiding each other?
Goto Forum:
  


Current Time: Thu Mar 04 03:17:27 GMT 2021

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

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

Back to the top