Get attributes of Applied Stereotype

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Get attributes of Applied Stereotype

Postby ajinkya.jumbad@1eQ.com » Fri Jul 12, 2019 6:44 am

Hello,
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 ?
ajinkya.jumbad@1eQ.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:1
Joined: Thu Apr 25, 2019 6:29 am

Re: Get attributes of Applied Stereotype

Postby stephen.curtin@vnbs.com » Mon Jul 15, 2019 11:14 am

Hi,
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)
or
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.
stephen.curtin@vnbs.com
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 2 guests

cron