Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EOL/EVL] Class references
[EOL/EVL] Class references [message #1694097] Thu, 30 April 2015 14:23 Go to next message
Alexandre Garcia is currently offline Alexandre GarciaFriend
Messages: 3
Registered: April 2015
Junior Member
Hi,
In my metamodel I specified a "Class" class and it has a "subClassOf" reference/association with itself. My problem is that I specified a constraint that avoids a class to be related by the subClassOf association with itself and I would like to write a fix that removes this specific association but I can't find anything that explains how to do that in EOL/EVL. Is it ever possible? I mean, is there available any operation in EOL that allows me to remove a specific association/reference? I was digging a while (and reading the Epsilon Book chapter about EOL) and I can't find anything for that

Regards
Re: [EOL/EVL] Class references [message #1694148 is a reply to message #1694097] Thu, 30 April 2015 22:26 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Alexandre,

If subClassOf is a multi-valued reference, self.subClassOf.remove(self) would do the trick. If subClassOf is single-valued, self.subClassOf = null would unset the reference. Does this help?

Cheers,
Dimitris
Re: [EOL/EVL] Class references [message #1694150 is a reply to message #1694148] Thu, 30 April 2015 23:13 Go to previous messageGo to next message
Alexandre Garcia is currently offline Alexandre GarciaFriend
Messages: 3
Registered: April 2015
Junior Member
Yes, it helps but there is one thing that isn't being replicated which is the possibility to remove the link from the generated editor.
My EMF looks like:

@gmf.node(label="uri", figure="ellipse", label.edit.pattern="{0}", label.view.pattern="<<Class>> {0}", label.icon="false")
class Class extends Resource {

  @gmf.link(target="subClassOf", target.decoration="arrow", label.text="subClassOf", label.readOnly="true")
  ref Class[*] subClassOf;
}


And when I do the fix with self.subClassOf.remove(self) the link isn't removed (although now the model now passes the validation). Is there any easy way to do that?

Regards
Re: [EOL/EVL] Class references [message #1694153 is a reply to message #1694150] Fri, 01 May 2015 00:32 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Alexandre,

If you refresh the diagram manually (F5?) does the link disappear?

Cheers,
Dimitris
Re: [EOL/EVL] Class references [message #1694155 is a reply to message #1694153] Fri, 01 May 2015 00:48 Go to previous messageGo to next message
Alexandre Garcia is currently offline Alexandre GarciaFriend
Messages: 3
Registered: April 2015
Junior Member
Yes it does Smile
Is it possible in some way to "force" the update of the model? Or is it necessary to refresh manually?

Regards

[Updated on: Fri, 01 May 2015 00:49]

Report message to a moderator

Re: [EOL/EVL] Class references [message #1694368 is a reply to message #1694155] Mon, 04 May 2015 21:14 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Alexandre,

This should work out of the box. Could you please share a minimal example [1] I can use to reproduce this locally?

Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Previous Topic:[ETL/EOL] How to Change properties of an existing InMemoryEmfModel instance?
Next Topic:[Help]Cannot generate GMF tool, graph and map models
Goto Forum:
  


Current Time: Fri Apr 26 04:14:39 GMT 2024

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

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

Back to the top