Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3] select() work on Acceleo 2 but not on Acceleo 3
[Acceleo 3] select() work on Acceleo 2 but not on Acceleo 3 [message #719854] Mon, 29 August 2011 04:36 Go to next message
Eclipse UserFriend
Hi,

I try to migrate a projet from Acceleo 2.6 to Acceleo 3.1 and i have a problem with

requests.

in my acceleo 2 project i have this code ( ownedParameter[direction=="in"])

<%for (ownedOperation){%>
    <% common_signature%>(<%ownedParameter[direction=="in"].nSort().common_parameter.sep(", ")%>) throws GenericException{


then with this code, request filter only on parameter with direction = "in" that is good.

on acceleo 3 i write this :
[for (ownedOperation)]
[javadoc_method()/]
    [common_signature()/]([ownedParameter->select(direction = 'in')->sortedBy(toString()).common_parameter()->sep(', ')/]) throws GenericException{


then ownedParameter->select(direction = 'in') return always nothing.


Could you help me to find my mistakes

thanks
Re: [Acceleo 3] select() work on Acceleo 2 but not on Acceleo 3 [message #719907 is a reply to message #719854] Mon, 29 August 2011 08:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

You should change your code for something like this:
ownedParameter->select(direction = DirectionKind::IN)


Since I'm pretty sure that the direction in your metamodel is an enumeration and enumerations are manipulated differently in Acceleo 3 (MyObject.myEnumValue = MyEumeration::myEnumerationLiteral).

For more information, you can have a look at the Acceleo user guide which contains videos and tons of screenshots, the best practices guide (where you can find lot of information to create a good generator and where we are often adding new recommendations). the FAQ or even an open source example of UML to Java generator that you can fork as you want.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo 3] select() work on Acceleo 2 but not on Acceleo 3 [message #719990 is a reply to message #719907] Mon, 29 August 2011 11:57 Go to previous message
Eclipse UserFriend
Hi,

Thansk for your answer.

The good enumeration for metamodel UML2 is ParameterDirectionKind
Previous Topic:[Acceleo 3.x] Problem exporting Acceleo project as plugin
Next Topic:[Acceleo]
Goto Forum:
  


Current Time: Wed Jul 16 16:37:29 EDT 2025

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

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

Back to the top