|
Re: Howto use Acceleo with a UML Profile [message #1221299 is a reply to message #1220885] |
Tue, 17 December 2013 10:48 |
Siegfried Nolte Messages: 48 Registered: August 2009 |
Member |
|
|
Hi Marc,
first of all if you use UML-metamodel that will be OK. Profiling is something that can be done with UML.
Anyway, your model (model.uml) should know the model.profile. So everything will be all right, if you are doing some m2t on your model.
For instance youm may try something as follows:
[template public generatePackage(p : Package)]
[comment @main /]
[if (p.isStereotypeApplied(p.getApplicableStereotype('MVC-Profile::MVC')))]
[p.generateMain()/]
[/if]
[/template]
There is a MVC-Profile with a stereotype 'MVC'. If I find a stereotyped package, I will do some generation.
Got it so far?
Best regards,
Siegfried
[Updated on: Tue, 17 December 2013 12:30] Report message to a moderator
|
|
|
Re: Howto use Acceleo with a UML Profile [message #1221496 is a reply to message #1221299] |
Tue, 17 December 2013 20:42 |
Marc B Messages: 2 Registered: December 2013 |
Junior Member |
|
|
Hi,
Thank you for your answer
Well, actually, I don't see where to add these lines. :s
You're right, I profiled my model using the UML metamodel. So in Papyrus, my model.uml knows model.profile.uml.
But when I copy these files in Acceleo, I don't know how to "link" my model with the profile...
With a non-profiled UML model, to generate code, I add my model, create an new "Empty Generator" and choose Type value: "uml.Class". Then I get a default.mt file. Then, in the Outline, I right click my model, "Acceleo">"Select Template" and then "Acceleo">"Generate File(s)". It generates a file for each class I have in my model. [Btw, I'm not sure if it's the good way to do this...]
Now, in my profiled model, I don't have class anymore, but a stereotype (called my_class and extending Class). I'd like to do the same thing I did with Class, but with my_class.
Thanks for your help.
Marc
Edit : Problem solved ! It works !!
It was just a pb of metamodel "http://www.eclipse.org/uml2/3.0.0/UML" instead of metamodel "http://www.eclipse.org/uml2/2.0.0/UML". The pb only took place in the profiled model, that's why it didn't work. Thanks for your help Siegfried Mising name !
[Updated on: Tue, 17 December 2013 21:55] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03861 seconds