Skip to main content


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 13:11 Go to next message
saadia dhouib is currently offline saadia dhouibFriend
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 05:33 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
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 09:10 Go to previous message
saadia dhouib is currently offline saadia dhouibFriend
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: Tue Apr 23 12:14:38 GMT 2024

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

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

Back to the top