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 08:53 Go to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
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 10:08 Go to previous messageGo to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
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 05:26 Go to previous messageGo to next message
Sir Wayne is currently offline Sir Wayne
Messages: 206
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 05:43]

Report message to a moderator

Re: Check Assoziation in Xtend [message #661123 is a reply to message #658889] Wed, 23 March 2011 05:46 Go to previous message
Sir Wayne is currently offline Sir Wayne
Messages: 206
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 05:56]

Report message to a moderator

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


Current Time: Thu Aug 28 01:27:34 EDT 2014

Powered by FUDForum. Page generated in 0.02320 seconds