|SysML & ACCELEO [message #1007255]
||Tue, 05 February 2013 04:39
| Andrea Sindico
Registered: November 2010
I am defining a M2T transformation through Acceleo from an input SysML model defined via papyrus. |
I am having some problem while trying to retrieve SysML stereotypes. For the sake of simplicity I just provide a simplified version of the whole transformation.
[template public generateElement(model : Model) post(trim())]
[c.name/] [c.oclIsKindOf(Block)/] [c.oclAsType(Block).base_Class.name/] [c.getAppliedStereotype('SysML::Blocks::Block')->notEmpty()/]
The only output I get for a test model containing just one Block named Block1 is
Block1 false invalid true
which means the Block is not recognized to be an instance of the Block meta-class (see the first for)
it is instead recognized as a stereotyped class.
However I do remember the first for worked in previos Papyrus/Acceleo versions.
Am I doing something wrong?
Follow me on Twitter @andreasindico
[Updated on: Tue, 05 February 2013 05:35]
Report message to a moderator
|Re: SysML & ACCELEO [message #1007299 is a reply to message #1007255]
||Tue, 05 February 2013 07:43
| Camille Letavernier
Registered: February 2011
From the Ecore point of view, a Block simply contains a reference to its base Element (base_Class). There is absolutely no inheritance relationship, it is a reference. And the UML Element contains a few methods to retrieve the applied stereotypes.
Papyrus and UML do not provide any further support. So, basically:
- A Block is not a Class
- A Class cannot be cast to a Block
You can still retrieve the Block object with "c.getStereotypeApplication('SysML::Blocks::Block')"
The same goes for all Stereotypes in all profiles.
If Acceleo provides (or used to provide, or is supposed to...) a specific support for UML Profiles, you will probably find more information directly on their forum.
Powered by FUDForum
. Page generated in 0.01974 seconds