Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: LNS_Software on September 21, 2004, 01:17:56 pm
-
I am trying to determine how to get the stereotype of a linked attribute. I am developing a model that also includes hooks for future capabilities. I have stereotyped the class and association as "future".
I've updated the template for the class to:
%if classStereotype == "future"%
%endTemplate%
But cannot seem to find the stereotype for a linked attribute.
Also, how does a Linked Attribute template start? According to the class body, it uses a %list to include the attributes, but in attributes there is no hook to Linked Attributes.
Any ideas?
-
Hi,
Currently there is no way to get a link stereotype. The list of possible substitution macros is available in the help.
http://www.sparxsystems.com.au/EAUserGuide/fieldsubstitutionmacros.htm
Also in the help is this.
There are some special cases to consider when using the list macro:
ยท If the Attribute template is used as an argument to the list macro, this will also generate attributes derived from associations by executing the appropriate LinkedAttribute template
That can be found at http://www.sparxsystems.com.au/EAUserGuide/controlmacros.htm
Hope this helps.
Simon
-
I cannot get at the Linked Attributes. If I try to create a custom template, "Linked Attribute" does not appear.
If I say:
%list="Attribute__ListAttributes" @separator="\n\n" @indent="\t"%
I only get the attributes, I don't get the linked attributes.
(I'm hoping it doesn't come down to having to build one of those unsupported ADD-IN's).
-
Well, you do have a bit of a problem there... At the moment you can't create a custom template for linked attributes, and executing a custom template for attributes does not and is not intended to also execute linked attributes.
I do have some good news for you though...
There is actually a way to get In response to this I have included the ability to get the stereotype of a linked attribute. The substitution macro %linkStereotype% hasn't been documented but does work. :-[
The other thing is that I've added the ability to create a custom template for linked attributes that you should get in build 738.
I'll also try to complete (I think) the options for that by adding ability to create custom templates for "ClassBase", "ClassInterface" and "ClassParameter"
Simon
-
While you're at it, can you add a couple of things that can be referenced in a linked attribute.
- Specifically accessing the source aggregration so I can tell whether the linked attribute is a shared or composite aggregation.
- A way to access the notes of an association.
- A way to access the tags of an association.
Thanks.