Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 08:36 Go to next message
flagadajones is currently offline flagadajones
Messages: 2
Registered: August 2011
Junior Member
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 12:27 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

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 15:57 Go to previous message
flagadajones is currently offline flagadajones
Messages: 2
Registered: August 2011
Junior Member
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: Sat Oct 25 14:44:10 GMT 2014

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

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