| applyStereotype on input model elements [message #908348] |
Wed, 05 September 2012 03:58  |
Martin Bauer Messages: 1 Registered: September 2012 |
Junior Member |
|
|
I use the eclipse QVTo and transform an uml model into an other uml model. The input model is also the output model (transformation t(inout umlin : UML) ...).
Question:
I can apply a stereotype on an element which i create before but i can not apply a stereotype on an element which is from the input model. That means an element that is not created during the transformations.
this works:
var c : Class:= object Class{name:="class"};
model.getClassDiagram().packagedElement+=c;
c.applyStereotype(c.getApplicableStereotype("myStereotype"));
but this not:
var c : Class:= model.getClass("myClass");
c.applyStereotype(c.getApplicableStereotype("myStereotype"));
the test c.getAppliedStereotype("myStereotype") <> null; is in both cases true but in the second case the output model file does not apply the stereotype on the element.
[Updated on: Wed, 05 September 2012 05:25] Report message to a moderator
|
|
|
| Re: applyStereotype on input model elements [message #908380 is a reply to message #908348] |
Wed, 05 September 2012 05:22  |
Ed Willink Messages: 3183 Registered: July 2009 |
Senior Member |
|
|
Hi
I'm afraid you're beyond my knowledge of the code. I'm gradually getting
to grips with stereotypes fro OCL and Papyrus; QVTo later.
However, as a result of a more general M2M discussion, I wondered how
output stereotypes could work at all in a declarative fashion.
After some investigation I spotted that the QVTo specification has a
"Type & Stereotype" syntax. I have no idea whether this is supported yet
in QVTo.
Regards
Ed Willink
On 05/09/2012 08:58, Martin Bauer wrote:
> I use the eclipse QVTo and transform an uml model into an other uml
> model. The input model is also the output model (transformation
> t(inout umlin : UML) ...).
>
> Question:
> I can apply a stereotype on an element which i create before but i can
> not apply a stereotype on an element which is from the input model.
> That means an element that is not created during the transformations.
>
> this works:
> var c : Class:= object Class{name:="class"};
> model.getClassDiagram().packagedElement+=c;
> c.applyStereotype(c.getApplicableStereotype("myStereotype"));
>
> but this not:
> var c : Class:= model.getClass("myClass");
> c.applyStereotype(c.getApplicableStereotype("myStereotype"));
>
> the test c.hasStereotype("myStereotype"); is in both cases true but in
> the second case the output model does not apply the stereotype.
>
|
|
|
Powered by
FUDForum. Page generated in 0.01520 seconds