Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Check Assoziation in Xtend
Check Assoziation in Xtend [message #658432] Tue, 08 March 2011 13:53 Go to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Hello,

follow code genereates my associations

«DEFINE accessors FOR uml::Classifier»
	«FOREACH AllAssociationProperties().select(e|e.type.name!=name&&e.isNavigable()) AS a»
		«EXPAND accessors FOR a»
	«ENDFOREACH»
«ENDDEFINE»


i want to check, if association which are not navigable have no name:

i try: but how i get only the associations instead of the property? i tried uml::Association but then i have no opposite.
context uml::Property WARNING name+"->"+opposite.name+": Warning	
!isNavigable() ? true : name.lenght == 0;


Thanks
Re: Check Assoziation in Xtend [message #658451 is a reply to message #658432] Tue, 08 March 2011 15:08 Go to previous messageGo to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
So it seems better:

context uml::Class ERROR this.name + ": ":
	allOwnedElements()
		.typeSelect(uml::Property)
		.select(p|p.association!=null)
		.forAll(p|p.name != null && p.name.length > 0 && p.isNavigable());
Re: Check Assoziation in Xtend [message #658889 is a reply to message #658451] Thu, 10 March 2011 10:26 Go to previous messageGo to next message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Hello,

how can i check association they are non-navigable and have no name.
My try:
context uml::Class ERROR this.name + ": Error should have no name":	allOwnedElements()
		.typeSelect(uml::Property)
		.select(p|p.association!=null && !p.isNavigable())
		.forAll(p|p.name == null || p.name.length == 0);

[Updated on: Wed, 23 March 2011 09:43]

Report message to a moderator

Re: Check Assoziation in Xtend [message #661123 is a reply to message #658889] Wed, 23 March 2011 09:46 Go to previous message
Dennis Melzer is currently offline Dennis MelzerFriend
Messages: 244
Registered: July 2009
Senior Member
Has nobody an idea, how i can check non navigable association without a rolename?

A non navigable association doesn't have to contain a rolename.

Doesn't work =(

context uml::Class ERROR this.name + " ERROR":
	allOwnedElements()
		.typeSelect(uml::Property)
		.select(p|p.association!=null && !p.isNavigable())
		.forAll(p|p.isUnnamed());

[Updated on: Wed, 23 March 2011 09:56]

Report message to a moderator

Previous Topic:[Acceleo] Using tuples
Next Topic:[xpand/mwe] worflow configuration example
Goto Forum:
  


Current Time: Fri Apr 26 10:36:56 GMT 2024

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

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

Back to the top