need interface column in sv-6

Discussions about UPDM functionalities

Moderators: lintut, Moderators

need interface column in sv-6

Postby justin.berrier@navy.mil » Wed Oct 03, 2018 8:51 am

Hello,

I'm trying to add a column on the sv-6 that shows both the source and target systems for each exchange with a dash in between them (i.e., system1-system2). I currently see separate columns displaying the producing and consuming systems for each exchange, but what I need is a column that combines these and is called Interface. Please help.

Justin
justin.berrier@navy.mil
Forum Beginner
Forum Beginner
 
Posts: 31
Posts Rating:1
Joined: Tue Nov 28, 2017 3:05 pm

Re: need interface column in sv-6

Postby paudzi » Thu Oct 04, 2018 2:25 am

Hello Justin,

This can be done by adding a custom column based on script. Below is a groovy script which connects source name and target name separated with dash:

Code: Select all
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element
import com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement

getElementRepresentation(arg1.getSource().iterator().next()) + " - " + getElementRepresentation(arg1.getTarget().iterator().next())

private static String getElementRepresentation(Element element)
{
    return (element instanceof NamedElement ? ((NamedElement) element).getName() : element.getHumanName())
}


Just copy/paste this script in your column specification.

With best regards,
No Magic Customer Support
paudzi
Customer Support
Customer Support
 
Posts: 70
Posts Rating:4
Joined: Thu Oct 20, 2011 5:50 am

Re: need interface column in sv-6

Postby justin.berrier@navy.mil » Thu Oct 04, 2018 8:36 am

Thx paudzi, thix works. For those trying to reproduce this, remember you must set the script Type to String and check the Single Value box.
justin.berrier@navy.mil
Forum Beginner
Forum Beginner
 
Posts: 31
Posts Rating:1
Joined: Tue Nov 28, 2017 3:05 pm


Return to UPDM

Who is online

Users browsing this forum: No registered users and 0 guests