Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL: How to check the aggregation kind of an association end
EVL: How to check the aggregation kind of an association end [message #1717971] Fri, 18 December 2015 10:59 Go to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Hi,

I want to check the aggregation kind of an association end with the following operation:

operation Association foo() : Boolean {
	for (end in self.memberEnds) {
		if (end.aggregation = 'shared')
			return true;
		}
		
		return false;
}


I used the
end.aggregation = Aggregation #a_shared 
condition in the if statement earlier. The error message was Cannot find enumeration literal Aggregation#a_shared in model M! Thus, here I have replaced the
end.aggregation = 'shared'
in the if condition. Although, there is no error message for this code but it is not functional!
My question is that "How can I check the aggregation kind in the if statement?" (the possible values of the end.aggregation can be composite, none, or shared).

Kind regards,
Alireza

[Updated on: Fri, 18 December 2015 11:16]

Report message to a moderator

Re: EVL: How to check the aggregation kind of an association end [message #1717982 is a reply to message #1717971] Fri, 18 December 2015 11:53 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 Alireza,

There doesn't seem to be an Aggregation enumeration in the UML metamodel but there is one called AggregationKind (i.e. AggregationKind#shared should do the trick). You may find Epsilon's EPackage Registry View [1] useful for exploring the UML metamodel.

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/epackage-registry-view/
Re: EVL: How to check the aggregation kind of an association end [message #1717984 is a reply to message #1717982] Fri, 18 December 2015 12:01 Go to previous message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitirs,

Thanks a lot. Your suggested trick solved the issue.

Kind regards,
Alireza

[Updated on: Fri, 18 December 2015 12:04]

Report message to a moderator

Previous Topic:EVL: Commonality in the pre-blocks of the contexts
Next Topic:EVL: Referencing all of the module constraints in the post block
Goto Forum:
  


Current Time: Wed Apr 24 15:43:47 GMT 2024

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

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

Back to the top