Author Topic: Code generation: package stereotypes  (Read 1286 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1288
  • Karma: +95/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Code generation: package stereotypes
« on: July 30, 2007, 07:04:07 pm »
Greetings,

In a Code Generation Template, is there any way to grab hold of a package stereotype?
There's no %packageStereotype% macro, and a Namespace stereotyped override seems to have no effect.
I'm on 6.5.806 in production, but my 7.0.813 evaluation installation appears to behave identically.

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Code generation: package stereotypes
« Reply #1 on: July 31, 2007, 02:42:05 am »
This is a long shot Uffe, but see if you can get a reference to the Element property of the Package. Several of the attributes of packages are attached to the underlying Element, since they are essentially the same as the same properties of any other Element type.

I don't know if the Stereotype property (or properties since there can be several) are part of this set, but it seems to me that they likely would be.

David
No, you can't have it!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1288
  • Karma: +95/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Code generation: package stereotypes
« Reply #2 on: July 31, 2007, 04:34:41 pm »
Alright, here's a 100% all-natural newbie question: how do I extract the properties? Other than the %package...%, and there's only four of them, I don't know any method of finding package properties.

In other news, the workaround I'm currently using is to create a package stereotype which has an enumerated tagged value. The enumeration type contains the different kinds of package I want to be able to recognize, and I can use the %packageTag% macro to find this value.

/Uffe
My theories are always correct, just apply them to the right reality.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6819
  • Karma: +63/-7
    • View Profile
Re: Code generation: package stereotypes
« Reply #3 on: July 31, 2007, 04:56:50 pm »
The macros available for packages were extended in build 812, and this should include packageStereotype.  The list is actually complete (in that it matches the class macros) except that some of the properties do not apply to packages.  (eg. IsLeaf)

The stereotype overrides do not apply as it is not a stereotype on either the class or the class feature.
Eve

support@sparxsystems.com