RE: Verifying Stereotypes with OCL constraints

Date view Thread view Subject view Author view Attachment view

From: Miroslaw Staron (
Date: Thu 25 Mar 2004 - 07:50:10 GMT

There is this Telelogic Tau G2 tool, which is UML 2.0 compliant. However, in
the respect of stereotypes it violates the assumption that there is no
navigation between the model element and a stereotype applied to it. Anyway,
even that it is not UML 2.0, it is close to the 2.0 spec not to 1.x.
When it comes to XMI, It seems to support its import (unisys extension),
however, I have not performed any major tests on compliance there.
Best Regards,
Miroslaw Staron


[] On Behalf Of Frédéric FONDEMENT
Sent: den 24 mars 2004 18:30
Subject: Re: Verifying Stereotypes with OCL constraints

Here my understanding in UML 2.0 profile, I hope somebody will complain on
this list if I tell bad stories...
The Stereotype metaclass inherits from the Class metaclass, so that you can
create an object out of it (a stereotype instance).
The Extension metaclass inherits from the Association metaclass and is used
to relate a stereotype and its metaclass, so that you can create a link out
of it. This link must have two ends: one on the stereotype instance, and the
other on the extended element, instance of the metaclass (but I cannot find
the constraint stating the extended element must be instance of this
metaclass... - see figure 455 and 458). The pity here is this link cannot be
navigated from the extended element (see 18.3.2). But from the stereotype
instance, it is possible to navigate the extended element, with the name
defined by the property of the extension. Note that by default OCL provides
a name to unnamed properties ends of associations.
In that we are in the context of UML, and as a stereotype inherits Class, a
stereotype instance is a metaclass, so, in a metalevel constraint, the
create.allInstance seems valid to me. To determine wether your trigger is a
creator or not, I assume it should be done a complicated query like:
    create.allInstances->exists(trigger = self.trigger)
The problem here is UML does not define the profile where the create
stereotype is defined. I feel this is an inconsistent way for the UML
metamodel: if it is the official metamodel, why must it be extended a
mandatory way ?
Personally, I must admit I merge stereotype and metaclass instances what
allows using the oclIsKindOf predefined operation
Does anyone know a tool UML 2.0 compliant that also deals with stereotypes
to check that with a good XMI ?
Frederic Fondement

----- Original Message ----- 
From: Miguel Goulão <>  
Sent: Wednesday, March 24, 2004 2:14 PM
Subject: Verifying Stereotypes with OCL constraints

How can one verify if a given model element in OCL has a specific
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 = implies
                 ((self.trigger->IsEmpty) or
                  ( = '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 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


Date view Thread view Subject view Author view Attachment view