I'm new to Acceleo. I use IBM RSA (8.5.1). I created a custom UML Profile (with a few stereotypes extending default metaclasses, it's pretty usual). The UML profile is a .epx file. In addition, I created a simple model on which I applied my custom UML Profile, and "tagged" a few classes with my custom stereotypes.
My questions (sorry if it is trivial, but I didn't find a straight answer...):
Can I use my custom UML Profile as metamodel in Acceleo? Simply saying, instead of writing in my module file the following: [module main('http://www.eclipse.org/uml2/3.0.0/UML')] (this one works okay) can I write something like this: [module main('platform:/resource/MyProfileProject/MyProfile.epx')]? If I try this, I get an error message: "The metamodel couldn't be resolved". I tried to convert my UML Profile from .epx format to .xmi and to .uml. None of those work.
If this can be made working somehow, can I use my custom stereotypes as type qualifiers in Acceleo templates (in "for" cycles, etc.)?
Any help is appreciated. Thank you in advance. Marcell
It can be done. I'm adding an example to show how to do it, since it took me quite some time to retrieve the profile stereotypes. I'm adding it for a future reference (to whoever may need it).
Notice that in the code above, the qualified name
Soa Logic Profile::bOperation
corresponds to the stereotypebOperation
defined in theSoa Logic Profile
.entity
is a stereotype defined in theUML Standard Profile
. BothSoa Logic Profile::bOperation
andUML Standard Profile::entity
are qualified names.Note: You only need to use the UML-metamodel, this model (the
.uml file
) already has information about the applied profile. This can be checked by inspecting the .uml file. Also, as far as I understand, the *.profile.uml files do have to be in the same folder as the .uml model file.Greetings from Paraguay!