Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [XPAND] [XTEND] hot to get the number of parameters for an operation
[XPAND] [XTEND] hot to get the number of parameters for an operation [message #504715] Tue, 22 December 2009 05:31 Go to next message
Eclipse UserFriend
hello to all,

I want to get the number of parameters of an operation to generate Java code out of UML
I need only the number of parameters to insert it inside an array.
I have something like the following.. I do not know what to insert inside the FOREACH block instead of the question marks.

«FOREACH trueParameters() AS p ITERATOR i-»
?????????????????????????
«ENDFOREACH»


thanx in-advance
Re: [XPAND] [XTEND] hot to get the number of parameters for an operation [message #504722 is a reply to message #504715] Tue, 22 December 2009 00:44 Go to previous messageGo to next message
Eclipse UserFriend
I'm assuming that you mean parameters for an uml::Operation...

«FOREACH ownedParameters.reject(e|e.direction!=uml::ParameterDirectionKind::return) AS p ITERATOR i-»
«ENDFOREACH»

Re: [XPAND] [XTEND] hot to get the number of parameters for an operation [message #504724 is a reply to message #504722] Tue, 22 December 2009 05:47 Go to previous messageGo to next message
Eclipse UserFriend
yes true ...
Re: [XPAND] [XTEND] hot to get the number of parameters for an operation [message #504735 is a reply to message #504722] Tue, 22 December 2009 06:12 Go to previous messageGo to next message
Eclipse UserFriend
have you answered my question?

Karsten Thoms wrote on Tue, 22 December 2009 00:44
I'm assuming that you mean parameters for an uml::Operation...

«FOREACH ownedParameters.reject(e|e.direction!=uml::ParameterDirectionKind::return) AS p ITERATOR i-»
«ENDFOREACH»



Re: [XPAND] [XTEND] hot to get the number of parameters for an operation [message #504882 is a reply to message #504735] Wed, 23 December 2009 05:23 Go to previous message
Eclipse UserFriend
the following has worked
xtend
int count (uml::Operation o) : o.ownedParameter.size;


and call it in your template like this

«count()-1»


Previous Topic:Xpand copy files as-is
Next Topic:[Xtext] Can a keyword not be generated as a lexer rule ?
Goto Forum:
  


Current Time: Wed Jul 23 13:16:03 EDT 2025

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

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

Back to the top