Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Evaluation - get all the elements that are linked to selected element within a collection
Evaluation - get all the elements that are linked to selected element within a collection [message #1178197] Sat, 09 November 2013 13:12 Go to next message
Zarko Milosavljevic is currently offline Zarko MilosavljevicFriend
Messages: 2
Registered: November 2013
Junior Member
I'd like to know if there's a way, and if yes, how to get list (or any other collection for that matter) of all the elements that are linked to targeted element. I'm writing dsl for data flow diagram and i need this in order to check if decomposition has been done properly. The example would be that process d is linked to data storage a, and external entity b, and by basic rules of decomposition, if you're decomposing by process d you need to have all of the elements that he was connected to on lower level of decomposition.
Re: Evaluation - get all the elements that are linked to selected element within a collection [message #1180099 is a reply to message #1178197] Sun, 10 November 2013 19:38 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi Zarko,

You can compute a collection of all the elements that refer to a particular element by navigating the appropriate references in the metamodel. For example, for models conforming to the metamodel in [1], to find all the books and libraries connected to a particular writer "w1", you could use the following EOL program:

var w1 : Writer; // The writer in question
var connected : Sequence; // All elements directly connected to that writer
w1 = ...;
connected.addAll(w1.books);
connected.addAll(Library.all.select(l|l.writers.includes(w1)));
connected.println();

Does this help?

Cheers,
Dimitris

[1] http://eclipse.org/epsilon/doc/articles/reflective-emf-tutorial/
Re: Evaluation - get all the elements that are linked to selected element within a collection [message #1181207 is a reply to message #1180099] Mon, 11 November 2013 12:52 Go to previous message
Zarko Milosavljevic is currently offline Zarko MilosavljevicFriend
Messages: 2
Registered: November 2013
Junior Member
Yes, very helpful indeed. It gave me an idea to the approach i should take to solve my problem. Thank you very much!
Previous Topic:Setting xsi:noNamespaceSchemaLocation in generated xsd-back xml
Next Topic:ecl ant task doesn't "see" inherited elements from a metamodel
Goto Forum:
  


Current Time: Thu Apr 18 23:09:59 GMT 2024

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

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

Back to the top