Get attributes of Applied Stereotype

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Get attributes of Applied Stereotype

Postby » Fri Jul 12, 2019 6:44 am

We are trying to integrate magicdraw into our company product and were going through the open APIs. We have a requirement(SysML) object which is infact a Class with stereotype on it. When we get a hold of this object in java, we get a instance of ClassImpl. From this ClassImpl,
We are unable to find apis to access the "Id", "text" property of requirement stereotype. Any help ?
Forum Newbie
Forum Newbie
Posts: 1
Posts Rating:1
Joined: Thu Apr 25, 2019 6:29 am

Re: Get attributes of Applied Stereotype

Postby » Mon Jul 15, 2019 11:14 am

Check out: com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper

You need something like:

java.util.List<java.lang.String> LIST = StereotypesHelper.getStereotypePropertyValueAsString(Element element, Stereotype stereotype, java.lang.String propertyName)
java.util.List<java.lang.String> LIST = StereotypesHelper.getStereotypePropertyValueAsString(Element element, java.lang.String stereotype, java.lang.String propertyName)

Both get the stereotype property value as list

There's also setStereotypePropertyValue functions.

Hope that helps.
Forum Newbie
Forum Newbie
Posts: 1
Posts Rating:0
Joined: Sun Sep 02, 2018 8:45 am

Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 0 guests