|[Acceleo 3.1] Problem with identifiers of protected [message #723298]
||Thu, 08 September 2011 05:22
Registered: June 2011
I have a Problem with the identifiers of protected areas.
Let me explain this in an example:
this is my acceleo part to generate User-define code for Operations:
[template public genOP(op : Operation)]
/*[protected ('for: ' +op.name+'*/')]
If im generating and putting something between the protected tags, the code is still there if im regenerating.
If im changing the Operation name, the identifier changes and the code is lost.
I know that changing the name worked in the past. What i doing wrong? Is it possible to bind user define code to the exact id in the uml file(at least with java)?
For my project it is necessary that changing identifiers is possible.
|Re: [Acceleo 3.1] Problem with identifiers of protected [message #724364 is a reply to message #723298]
||Mon, 12 September 2011 03:53
| Stephane Begaudeau
Registered: April 2010
Location: Nantes (France)
Norman wrote on Thu, 08 September 2011 11:22
I know that changing the name worked in the past.
I don't see how it could have worked, we are matching the previously generated protected marker with the newly generated ones.
Anyway, you can change the protected area marker manually or you can ignore protected areas and have your users override the method of the generated classes instead of modifying the generated classes. It may break after some changes (if the method changes it may not compile anymore) but the user code will not be put into a ."lost" file. Finally if you are generating Java source code, you can use JMerge insttead. With JMerge, you can put a "@generated NOT" tag in the documentation of the method and Acceleo will consider the whole method as being protected. You can see an example of JMerge in the generated Java launcher class created by Acceleo. If you want to see JMerge in action, you can have a look at this video.
Stephane Begaudeau, Obeo
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Powered by FUDForum
. Page generated in 0.03082 seconds