check Reading stereotype property value in model

1 year 10 months ago #5990 by joset
Hi,

1) I created a stereotype inside LocalModule/LocalProfile with properties (inside PropertyTableDefinition)
2) I assigned this stereotype on on attribute inside class
3) I filled the stereotype properties with values

When i run my jython script, i get the steretype but the properties inside the stereotype are unreachable.

Please help me find the method to extract the values from the setreotype properties.

Thanks, José
Attachments:

Please Log in or Create an account to join the conversation.

1 year 10 months ago #5991 by joset
Finally i found !

In fact the steretype is attached to the attribute (inside the class) but the stereotype properties are not attached to the stereotype :-)

They are attached to the parent attribute (inside the class), so the code to reach the sterreotype properties is:

attrbuteinclass.getProperties()[0].getContent()

Weird but it works !!

Please Log in or Create an account to join the conversation.

1 year 10 months ago #6004 by ebr
Many other solution/way to acces are possible.

For example, you can use the following code in which you first get the desired stereotype and then the "toto" property from the TypedPropertyTable related to the desired stereotype.
ster =  elt.getExtension().get(0)
print elt.getProperty(ster, "toto")

For nformation, the Java API (accessible from juthon script) is described here .

Hoping it helps,
EBR

Please Log in or Create an account to join the conversation.

1 year 9 months ago #6037 by joset
Thx EBR,

i found it and read your answer after ... :-)

Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.155 seconds
^ Back to Top