Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » applyStereotype on input model elements(applyStereotype on input model elements)
applyStereotype on input model elements [message #908348] Wed, 05 September 2012 07:58 Go to next message
Martin Bauer is currently offline Martin BauerFriend
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 09:25]

Report message to a moderator

Re: applyStereotype on input model elements [message #908380 is a reply to message #908348] Wed, 05 September 2012 09:22 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
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.
>
Previous Topic:Concat EString and String - 3.1 -> 3.3 regress ?
Next Topic:[Teneo,QVTo] QVTo + Teneo + Javassist -- possible or not?
Goto Forum:
  


Current Time: Thu Mar 28 23:39:22 GMT 2024

Powered by FUDForum. Page generated in 0.02215 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top