Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » Retrivieving stereotypes tagged values
Retrivieving stereotypes tagged values [message #1100700] Tue, 03 September 2013 09:11 Go to next message
saadia dhouib is currently offline saadia dhouib
Messages: 36
Registered: April 2010
Member
Hi,

I have a model with a uml profile applied on it.
I try to retrive the value of an attribure that is typed by an enumeration, and then to cast this value to an enumerationliteral. I notice that the cast to UML::EnumerationLiteral is not accepted!

var stereotype : Stereotype = self.getAppliedStereotypes() ->any(true);

log("stereotype", stereotype);

log("variability value: ",self.getValue(stereotype, "variability"));		

var variability : UML::EnumerationLiteral = 
self.getValue(self.getAppliedStereotypes()->any(true), "variability").oclAsType(UML::EnumerationLiteral);		

log("variabitlity value oclAsType(UML::EnumerationLiteral)",variability);


The result in the console is:
Quote:

stereotype, data: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@1d085050 (name: ModelicaValueProperty, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false)
variability value: , data: continuous
variabitlity value oclAsType(UML::EnumerationLiteral), data: <Invalid>


this is a snapshot of the setreotype:
http://s17.postimg.org/9egx58pmn/Screen_Shot004.jpg

Re: Retrivieving stereotypes tagged values [message #1101184 is a reply to message #1100700] Wed, 04 September 2013 01:33 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4033
Registered: July 2009
Senior Member
Hi

So it probably isn't a UML::EnumerationLiteral. Try to find out what it
is. use eClass()/debugger.

Regards

Ed Willink

On 03/09/2013 14:11, saadia dhouib wrote:
> Hi,
>
> I have a model with a uml profile applied on it.
> I try to retrive the value of an attribure that is typed by an
> enumeration, and then to cast this value to an enumerationliteral. I
> notice that the cast to UML::EnumerationLiteral is not accepted!
>
>
> var stereotype : Stereotype = self.getAppliedStereotypes() ->any(true);
>
> log("stereotype", stereotype);
>
> log("variability value: ",self.getValue(stereotype, "variability"));
>
> var variability : UML::EnumerationLiteral =
> self.getValue(self.getAppliedStereotypes()->any(true),
> "variability").oclAsType(UML::EnumerationLiteral);
>
> log("variabitlity value oclAsType(UML::EnumerationLiteral)",variability);
>
>
> The result in the console is:
> Quote:
>> stereotype, data:
>> org.eclipse.uml2.uml.internal.impl.StereotypeImpl@1d085050 (name:
>> ModelicaValueProperty, visibility: <unset>) (isLeaf: false,
>> isAbstract: false, isFinalSpecialization: false) (isActive: false)
>> variability value: , data: continuous
>> variabitlity value oclAsType(UML::EnumerationLiteral), data: <Invalid>
>
>
> this is a snapshot of the setreotype:
>
>
>
Re: Retrivieving stereotypes tagged values [message #1101295 is a reply to message #1101184] Wed, 04 September 2013 05:10 Go to previous message
saadia dhouib is currently offline saadia dhouib
Messages: 36
Registered: April 2010
Member
There is no way to get the eclass of self.getValue(stereotype, "variability")
Previous Topic:Problem with Stereotype application
Next Topic:Creating objects in secondary extents
Goto Forum:
  


Current Time: Wed Aug 27 15:08:32 EDT 2014

Powered by FUDForum. Page generated in 0.01780 seconds