Skip to main content



      Home
Home » Modeling » Epsilon » [EOL/EVL] Class references
[EOL/EVL] Class references [message #1694097] Thu, 30 April 2015 10:23 Go to next message
Eclipse UserFriend
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 18:26 Go to previous messageGo to next message
Eclipse UserFriend
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 19:13 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 30 April 2015 20:32 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 30 April 2015 20:48 Go to previous messageGo to next message
Eclipse UserFriend
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: Thu, 30 April 2015 20:49] by Moderator

Re: [EOL/EVL] Class references [message #1694368 is a reply to message #1694155] Mon, 04 May 2015 17:14 Go to previous message
Eclipse UserFriend
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 Nov 07 16:05:45 EST 2025

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

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

Back to the top