Author Topic: List the attributes of the element  (Read 5606 times)

medina

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
List the attributes of the element
« on: February 03, 2012, 07:21:33 pm »
I was wondering how I can make a stereotype list the attributes it contains. I have looked in shape script but can't find anything, or is it something i need to add in the profiles diagram for my MDG?. Would really appreciate the help!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: List the attributes of the element
« Reply #1 on: February 03, 2012, 10:08:29 pm »
Quote
make a stereotype list the attributes it contains
Ehrm - what?

q.

medina

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: List the attributes of the element
« Reply #2 on: February 03, 2012, 10:43:24 pm »
sorry i meant that i have made a stereotype and this stereotype has attributes that i have added. And i want these attributes to show as a list in this stereotype. Like this image
 
http://www.sparxsystems.com/enterprise_architect_user_guide/images/importtablesdiagram.png

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: List the attributes of the element
« Reply #3 on: February 03, 2012, 11:07:27 pm »
(meta) attributes on stereotypes will result in tagged values in on the actual elements.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: List the attributes of the element
« Reply #4 on: February 03, 2012, 11:25:46 pm »
Quote
sorry i meant that i have made a stereotype and this stereotype has attributes that i have added. And i want these attributes to show as a list in this stereotype. Like this image
 
http://www.sparxsystems.com/enterprise_architect_user_guide/images/importtablesdiagram.png
Geert is right. If you want some kind of default attributes to appear then you need to either use templates (I haven't really used that yet). Or you write an addin which catches element creation and adds attributes.

q.
« Last Edit: February 03, 2012, 11:26:20 pm by qwerty »

medina

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: List the attributes of the element
« Reply #5 on: February 08, 2012, 02:02:35 am »
Hi

No, I do not want to make default attributes automatically to be added to the element.

I just want the Attribute Compartment to be made visible. So if the user adds an attribute, then the attribute (and its value) is to be shown in the compartment - as in this picture.
)

I'v tried to add the styleex and pdata to the Diagram Profile (HideAtts=0;) but the attribute compartment still doesn't show in the element, (as in the picture above).
 
I've also turned on (=1) all the _Attxxx listed on Supported Attributes

Maybe it has something to do with the Shape Script?
Using the example on Example Scripts
Code: [Select]
shape main {
       rectangle(0,0,100,100);
       addsubshape("namecompartment", 100, 20);
       addsubshape("stereotypecompartment", 100, 40);
       shape namecompartment {
               h_align = "center";
               editablefield = "name";
               rectangle(0,0,100,100);
               println("name: #name#");

       }
       shape stereotypecompartment {
               h_align = "center";
               editablefield = "stereotype";
               rectangle(0,0,100,100);
               println("stereotype: #stereotype#");
       }
}

with all the avail properties listed in Display Element Properties

I STILL cannot make attributes visible on the element.

Please help


[size=18]tl;dr[/size]
I'm looking for something like
[size=15]println("attribute: #ATTRIBUTE# #ATTRIBUTE.NAME# #ATTRIBUTE.VALUE#");[/size]
« Last Edit: February 08, 2012, 02:09:27 am by medina »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: List the attributes of the element
« Reply #6 on: February 08, 2012, 02:49:32 am »
Check your diagram properties and turn on attribue visibility.

q.

medina

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: List the attributes of the element
« Reply #7 on: February 08, 2012, 04:16:11 am »
I've done that. No luck.

I'm pretty sure(?) it's a shape script problem.
(hence the pseudo example... println("attribute: #ATTRIBUTE# #ATTRIBUTE.NAME# #ATTRIBUTE.VALUE#"))

Since using the "default" UML-Class element is working ("working"=showing its attributes as in the picture above) in my diagram but my own made element does not (even thou it HAS attributes).

So what is the Shape Script code for the Class element? anyone?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: List the attributes of the element
« Reply #8 on: February 08, 2012, 05:07:36 am »
A shape script is define only and only for classes with stereotypes since the shape script itself is part of the stereotype. Check Settings/UML/Stereotypes for any shape scripts.

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: List the attributes of the element
« Reply #9 on: February 08, 2012, 08:46:48 am »
It is a limitation of shape scripts that you cannot list an element's attributes or operations.
The Sparx Team
[email protected]