Book a Demo

Author Topic: Cannot instantiate a stereotype  (Read 3234 times)

Ksenia Wahler

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Cannot instantiate a stereotype
« on: June 09, 2009, 10:34:30 pm »
Hi there,

I am creating a MDG Technology, which contains a large profile (several hundred elements) among other things.

While I can instantiate most stereotypes when I use the MDG Technology, there are several that cannot be instantiated. Simply nothing happens if I drag the stereotype from the toolbox into a diagram, or if I try to use the Add Element wizard.

I cannot find any difference if I compare the working stereotypes and the non-working ones (e.g. both extend the same metaclass).

Any ideas?

Thanks!
Ksenia

Ksenia Wahler

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Cannot instantiate a stereotype
« Reply #1 on: June 10, 2009, 01:38:48 am »
I just discovered what part of the problem is. There are some stereotype references across different profiles in my MDG Technology, which causes problems. Does anybody know if it is at all possible to reference stereotypes across different profiles?

For example, I have something like this now inside my MDG Technology file:

...
<UMLProfiles>
<UMLProfile profiletype="uml2">
<Documentation id="AD939260-B" name="P1"/>
  <Content>
    <Stereotypes>
      <Stereotype name="ArchitectureMetaData" generalizes="MetaData"/>
      </Stereotypes>
  </Content>
</UMLProfile>

<UMLProfile profiletype="uml2">
<Documentation id="AD939260-C" name="P2"/>
  <Content>
    <Stereotypes>
       <Stereotype name="MetaData">
         <AppliesTo>
             <Apply type="Comment">
              <Property name="body" value=""/>
             </Apply>
          </AppliesTo>
      </Stereotypes>
  </Content>
</UMLProfile>
</UMLProfiles>
...

I assume that due to scoping, the MetaData cannot be found from P1. As a result, the ArchitecturalMetaData stereotype cannot be instantiated in a model once the MDG Technology is installed.

How can one make such a reference work without merging the profiles?


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Cannot instantiate a stereotype
« Reply #2 on: June 10, 2009, 09:28:46 pm »
I don't know if it is possible at all. If it is possible you might have to qualify the reference. Perhaps something like generalizes="P2::MetaData" will work.
No, you can't have it!

Ksenia Wahler

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Cannot instantiate a stereotype
« Reply #3 on: June 11, 2009, 07:18:38 am »
No, the :: does not work, I tried that already.