Re: Verifying Stereotypes with OCL constraints



Date view Thread view Subject view Author view Attachment view

From: Shashank (shashank@icmgworld.com)
Date: Wed 24 Mar 2004 - 14:23:51 GMT


In the section UML semantics where
BehavioralFeature is defined. It specifies stereoypes defined as
following:

Stereotypes
«create»
Specifies that the designated feature creates an instance of the
classifier to which the feature is attached. May be promoted to the
Classifier containing the feature.

This suggests that navigating to stereotype "create" is a valid
navigation for esp purpose when want tp specify instance creation of any
classifier.

regards,
Shashank

Miguel Goulão wrote:

> Hello, How can one verify if a given model element in OCL has a
> specific stereotype? For instance, in section 15.3.14 of the UML
> superstructure document, version 3 (030208), page 499, the
> specification of Transition (from BehaviorStatemachines), there is an
> association to trigger, specifying the triggers that may fire a
> transition. Among other constraints, there is one that says that an
> initial transition at the topmost level either has no trigger or it
> has a trigger with the stereotype "create", defined in OCL
> as: self.source.oclIsKindOf(Pseudostate) implies
> (self.source.oclAsType(Pseudostate).kind = #initial) implies
> (self.source.container = self.statemachine.top)
> implies                 ((self.trigger->IsEmpty) or
> (self.trigger.stereotype.name = 'create')) My question is, how can
> "self.trigger.stereotype" be a valid navigation on the UML 2.0
> metamodel? I can't find an attribute called stereotype in the
> trigger's class, or any of its ancestors, so I don't really understand
> how this works. Assuming this is not a mistake, what am I missing
> here?Is this the normal way of verifying stereotypes with OCL
> constraints, or is there a better one? Thanks in advance,Miguel--
> Miguel Goulão
> Departamento de Informática da FCT/ UNL
> Quinta da Torre, 2829-516 Caparica, Portugal
> Tel: +351-21 294 85 36  - Ext. 10731
> Fax: +351-21 294 85 41
> E-mail: miguel.goulao@di.fct.unl.pt
> http://ctp.di.fct.unl.pt/QUASAR

Date view Thread view Subject view Author view Attachment view