Show Metaclass in Generic Table Custom Column Script

General discussions about code engineering

Moderator: Moderators

Show Metaclass in Generic Table Custom Column Script

Postby james.ciarcia@navy.mil » Mon Aug 06, 2018 12:46 pm

Using CSM 18.5 sp3 I've created a Generic Table with a bunch of different model elements. It's easy to show what Stereotypes are applied, and it also shows the name of the (base) Metaclass in grey brackets after it. However, if there is no stereotype applied, or if the stereotype is applied to a more specific metaclass then there is no easy way to show the metaclass. So I figured a simple custom column would work. What is the right function(s) to call? cause I can't find it in the jdoc, and this code did not appear to work.

Groovy code:
Code: Select all
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element
import com.nomagic.magicdraw.core.Application
import com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper

StereotypesHelper.getMetaClassByClass(Application.getInstance().getProject(), arg1)


http://jdocs.nomagic.com/185_sp3/com/no ... ang.Class-

I've also found that custom column only seems to work when returning onjects of Java class mdkernel.impl.*Impl, a previous post suggesting returning a String, from getID() for example would work, but it does not. What are the restrictions on the return types from scripted custom columns?

https://community.nomagic.com/post16198.html?hilit=custom%20column%20script#p16198
james.ciarcia@navy.mil
Forum Newbie
Forum Newbie
 
Posts: 22
Posts Rating:1
Joined: Mon Jul 24, 2017 4:15 pm

Return to Code engineering

Who is online

Users browsing this forum: No registered users and 1 guest