Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Uffe on July 30, 2007, 07:04:07 pm

Title: Code generation: package stereotypes
Post by: Uffe 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
Title: Re: Code generation: package stereotypes
Post by: «Midnight» 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
Title: Re: Code generation: package stereotypes
Post by: Uffe 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
Title: Re: Code generation: package stereotypes
Post by: Eve 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.