Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Xcore dynamic instances support(Trying to use Xcore-defined models without code generation)
Xcore dynamic instances support [message #1408512] Fri, 15 August 2014 08:48 Go to next message
Csaba Koncz is currently offline Csaba KonczFriend
Messages: 49
Registered: July 2009
Member
Hi all,

I am experimenting with Sirius and I am really impressed by its capabilities.

One thing I would like to try out is using models defined in Xcore. This works if EMF code is generated and the generated package is available in the package registry, but does not if the Xcore model is defined in the same workspace with the VSM.

The first issue is that in the Sirius Specification Editor, Representation properties, on the Metamodels tab, the selection dialog opened by "Add from workspace" button does not show the Xcore files (only *.ecore).

The second issue is that the Model Explorer does not show the content of the dynamic instance XMIs that were created from the Xcore model. (I can open the XMIs with the Sample Reflective Ecore Editor).

The reason for using Xcore is that it enables me to define derived properties using Xbase expressions. These do not work only in the generated classes, but are evaluated even in the Reflective Ecore editor.

I am wondering whether it would be possible to have the same in Sirius-defined modelers.

Best regards,
Csaba
Re: Xcore dynamic instances support [message #1409610 is a reply to message #1408512] Mon, 18 August 2014 14:27 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 252
Registered: July 2009
Senior Member
Le 15/08/2014 10:48, Csaba Koncz a écrit :
> Hi all,

Hi,

>
> I am experimenting with Sirius and I am really impressed by its
> capabilities.

Thanks for your feedback!

>
> One thing I would like to try out is using models defined in Xcore. This
> works if EMF code is generated and the generated package is available
> in the package registry, but does not if the Xcore model is defined in
> the same workspace with the VSM.
>
> The first issue is that in the Sirius Specification Editor,
> Representation properties, on the Metamodels tab, the selection dialog
> opened by "Add from workspace" button does not show the Xcore files
> (only *.ecore).
> The second issue is that the Model Explorer does not show the content of
> the dynamic instance XMIs that were created from the Xcore model. (I can
> open the XMIs with the Sample Reflective Ecore Editor).
>
> The reason for using Xcore is that it enables me to define derived
> properties using Xbase expressions. These do not work only in the
> generated classes, but are evaluated even in the Reflective Ecore editor.
> I am wondering whether it would be possible to have the same in
> Sirius-defined modelers.
>
> Best regards,
> Csaba

Did you take a look to the previous topic about XCore [1] ?

Let us know if this topic answers your question.

Best regards,

[1]
https://www.eclipse.org/forums/index.php/mv/msg/627956/1219344/#msg_1219344

--
Laurent - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Xcore dynamic instances support [message #1413263 is a reply to message #1409610] Thu, 28 August 2014 07:09 Go to previous messageGo to next message
Csaba Koncz is currently offline Csaba KonczFriend
Messages: 49
Registered: July 2009
Member
Hi Laurent,

Thank you for your reply.

I checked the thread you mentioned and my scenario is the first one described in the message of Alex Lagarde: I am trying to define Sirius views on an Xcore-based metamodel.

I do have the "org.eclipse.sirius.runtime.ide.xtext" feature installed in my IDE.
However, the plugin contained in this feature (o.e.sirius.common.xtext) only contributes a resourceSet factory, it does not help in locating Xcore models in the workspace (which was the first problem I encountered).

What I then tried is to edit the .odesign file by hand and indicate the Ecore model location inside the .xcore file like this:
 <metamodel href="xm1.xcore#/EPackage"/>

This seemed to work, at least I get content assist for domain classes and features in the Specification Editor.

I am also able to create a representation file for the dynamic model instance I created from the Xcore model, but the view does not show correct data.

I am attaching a project that shows what I try to achieve. There are an .xcore file, an .xmi file containing an instance of the model, an .odesign and and .aird file, all in the model subfolder.

Thank you,
Csaba

p.s. Problems I currently see:
1. Lots of resources representing Java types (like java:/Objects/org.eclipse.emf.ecore.EPackage) being displayed in the Sirius Specification Editor. (Sometimes a see these also in the Model Explorer under the aird node.)

2. When saving the Specification Editor, A "Problems encountered in file java:/Objects/..." is reported for each Java type resource.

3. "Transaction aborted due to concurrent write" exception from the emf.transaction plugin when double clicking the aird file in Model Explorer.

I am using Sirius 2.0 stable snapshot from http://download.eclipse.org/sirius/updates/stable/2.0.0-S20140817-113443/luna
Re: Xcore dynamic instances support [message #1582930 is a reply to message #1413263] Sat, 24 January 2015 23:13 Go to previous messageGo to next message
Erick Hagstrom is currently offline Erick HagstromFriend
Messages: 108
Registered: April 2014
Location: USA
Senior Member
This sounds like what I'm trying to do: create a Sirius Viewpoint Specification based on an xcore model. So I tried what Csaba tried: I added a metamodel element to the .odesign file by hand. And I'm seeing the first two problems that Csaba mentions as well, so that's probably not the right approach. However, absent any documentation as to how exactly we're supposed to point a Diagram Description to a .xcore file--they don't show up in the list of metamodels in the workspace--I don't have any other idea how to do this.

I'm also seeing something else that's rather disturbing: Sirius is eating my .xcore file. It's happened twice now and is getting tedious. The .xcore file is in a separate Xcore project. Whenever I save my Viewpoint Specification file from the Sirius Specification Editor, I get all of the problem complaints that Csaba mentions, plus one more telling me there's a problem with my .xcore file. And when I go to look at it, it's completely empty. So yeah, there's a problem with the file.

I'm a pretty patient guy, but when something destroys another file for no apparent reason, I get a bit upset. This should NEVER happen.

I'm removing the metamodel element now. It's just too much trouble. I'll deal with the diminished validation later.
Re: Xcore dynamic instances support [message #1608400 is a reply to message #1413263] Mon, 09 February 2015 13:44 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 482
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Csaba,

Le 28/08/2014 09:09, Csaba Koncz a écrit :
> Hi Laurent,
>
> Thank you for your reply.
>
> I checked the thread you mentioned and my scenario is the first one described in the message of Alex Lagarde: I am trying to define Sirius views on an Xcore-based metamodel.
>
> I do have the "org.eclipse.sirius.runtime.ide.xtext" feature installed in my IDE.
> However, the plugin contained in this feature (o.e.sirius.common.xtext) only contributes a resourceSet factory, it does not help in locating Xcore models in the workspace (which was the first problem I encountered).
>
> What I then tried is to edit the .odesign file by hand and indicate the Ecore model location inside the .xcore file like this:
>
> <metamodel href="xm1.xcore#/EPackage"/>

An other option could be to deploy you xcore plugins, and to reference
it using the add from registry button (metamodels tab in the properties
view when you select a Diagram/Table/Tree description).

You could also open a bug to ask if it is possible to improve the add
from workspace wizard to make it propose xcore files [1].


>
> This seemed to work, at least I get content assist for domain classes and features in the Specification Editor.
>
> I am also able to create a representation file for the dynamic model instance I created from the Xcore model, but the view does not show correct data.
>
> I am attaching a project that shows what I try to achieve. There are an .xcore file, an .xmi file containing an instance of the model, an .odesign and and .aird file, all in the model subfolder.
>
> Thank you,
> Csaba
>
> p.s. Problems I currently see:
> 1. Lots of resources representing Java types (like java:/Objects/org.eclipse.emf.ecore.EPackage) being displayed in the Sirius Specification Editor. (Sometimes a see these also in the Model Explorer under the aird node.)

Thoses resources are loaded during the load of xm1.xcore, they
corresponds to types and resources referenced from your xcore model. The
editor displays all loaded resources.



> 2. When saving the Specification Editor, A "Problems encountered in file java:/Objects/..." is reported for each Java type resource.

This seems to be a bug occuring during the save: we/Sirius/the Xtext
bridge/the saving policy should detect that some files have been loaded
as library/external readonly resources and there should be no save
attempt on those files.

Could you create a bug for poblems 1 and 2 on the Sirius bugzilla [1] ?


> 3. "Transaction aborted due to concurrent write" exception from the emf.transaction plugin when double clicking the aird file in Model Explorer.
>
> I am using Sirius 2.0 stable snapshot from http://download.eclipse.org/sirius/updates/stable/2.0.0-S20140817-113443/luna
>
I did not get this error.


Regards

--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

Join the Sirius community at SiriusCon. Register for free: Nov. 9th Paris
http://www.siriuscon.org/
Re: Xcore dynamic instances support [message #1608411 is a reply to message #1608400] Mon, 09 February 2015 13:55 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 482
Registered: July 2009
Location: Nantes, France
Senior Member
Le 09/02/2015 14:44, Maxime Porhel a écrit :
> Hi Csaba,
>
> Le 28/08/2014 09:09, Csaba Koncz a écrit :
>> Hi Laurent,
>>
>> Thank you for your reply.
>>
>> I checked the thread you mentioned and my scenario is the first one
>> described in the message of Alex Lagarde: I am trying to define Sirius
>> views on an Xcore-based metamodel.
>>
>> I do have the "org.eclipse.sirius.runtime.ide.xtext" feature installed
>> in my IDE.
>> However, the plugin contained in this feature
>> (o.e.sirius.common.xtext) only contributes a resourceSet factory, it
>> does not help in locating Xcore models in the workspace (which was the
>> first problem I encountered).
>>
>> What I then tried is to edit the .odesign file by hand and indicate
>> the Ecore model location inside the .xcore file like this:
>>
>> <metamodel href="xm1.xcore#/EPackage"/>
>
> An other option could be to deploy you xcore plugins, and to reference
> it using the add from registry button (metamodels tab in the properties
> view when you select a Diagram/Table/Tree description).
>
> You could also open a bug to ask if it is possible to improve the add
> from workspace wizard to make it propose xcore files [1].
>
>
>>
>> This seemed to work, at least I get content assist for domain classes
>> and features in the Specification Editor.
>>
>> I am also able to create a representation file for the dynamic model
>> instance I created from the Xcore model, but the view does not show
>> correct data.
>>
>> I am attaching a project that shows what I try to achieve. There are
>> an .xcore file, an .xmi file containing an instance of the model, an
>> .odesign and and .aird file, all in the model subfolder.
>>
>> Thank you,
>> Csaba
>>
>> p.s. Problems I currently see:
>> 1. Lots of resources representing Java types (like
>> java:/Objects/org.eclipse.emf.ecore.EPackage) being displayed in the
>> Sirius Specification Editor. (Sometimes a see these also in the Model
>> Explorer under the aird node.)
>
> Thoses resources are loaded during the load of xm1.xcore, they
> corresponds to types and resources referenced from your xcore model. The
> editor displays all loaded resources.
>
>
>
>> 2. When saving the Specification Editor, A "Problems encountered in
>> file java:/Objects/..." is reported for each Java type resource.
>
> This seems to be a bug occuring during the save: we/Sirius/the Xtext
> bridge/the saving policy should detect that some files have been loaded
> as library/external readonly resources and there should be no save
> attempt on those files.
>
> Could you create a bug for poblems 1 and 2 on the Sirius bugzilla [1] ?
>
>
>> 3. "Transaction aborted due to concurrent write" exception from the
>> emf.transaction plugin when double clicking the aird file in Model
>> Explorer.
>>
>> I am using Sirius 2.0 stable snapshot from
>> http://download.eclipse.org/sirius/updates/stable/2.0.0-S20140817-113443/luna
>>
>>
> I did not get this error.
(Sirius 2.0.4-S20150206-085250/luna and also tested on master)
>
>
> Regards
>


--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

Join the Sirius community at SiriusCon. Register for free: Nov. 9th Paris
http://www.siriuscon.org/
Re: Xcore dynamic instances support [message #1608423 is a reply to message #1582930] Mon, 09 February 2015 14:00 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 482
Registered: July 2009
Location: Nantes, France
Senior Member
Le 25/01/2015 00:13, Erick Hagstrom a écrit :
> This sounds like what I'm trying to do: create a Sirius Viewpoint
> Specification based on an xcore model. So I tried what Csaba tried: I
> added a metamodel element to the .odesign file by hand. And I'm seeing
> the first two problems that Csaba mentions as well, so that's probably
> not the right approach. However, absent any documentation as to how
> exactly we're supposed to point a Diagram Description to a .xcore
> file--they don't show up in the list of metamodels in the workspace--I
> don't have any other idea how to do this.

As explain to Csaba, the wizard "add from workspace" only display ecore
files. I think you could create a bug on the Sirius bugzilla to ask for
an improvment of the wizard to give it the possibility to show xcore files.

If you deploy you xcore plugins, you should be able to reference your
metamodel with the "add from registry action".


>
> I'm also seeing something else that's rather disturbing: Sirius is
> eating my .xcore file. It's happened twice now and is getting tedious.
> The .xcore file is in a separate Xcore project. Whenever I save my
> Viewpoint Specification file from the Sirius Specification Editor, I get
> all of the problem complaints that Csaba mentions, plus one more telling
> me there's a problem with my .xcore file. And when I go to look at it,
> it's completely empty. So yeah, there's a problem with the file.
>
> I'm a pretty patient guy, but when something destroys another file for
> no apparent reason, I get a bit upset. This should NEVER happen.

Could you open a bug for this problems with a small sample showing your
issue ? I was not able to reproduce the issue.
>
> I'm removing the metamodel element now. It's just too much trouble. I'll
> deal with the diminished validation later.

Regards

--
Maxime - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

Join the Sirius community at SiriusCon. Register for free: Nov. 9th Paris
http://www.siriuscon.org/
Previous Topic:How to add Ecore types as a platform resource to a Sirius design project
Next Topic:How to create an editor/diagram editpart without opening it?
Goto Forum:
  


Current Time: Tue Apr 07 06:39:11 GMT 2020

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

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

Back to the top