Determine end-to-end connectivity over 'passive' parts

General discussions about MagicDraw

Moderator: Moderators

Determine end-to-end connectivity over 'passive' parts

Postby david.d.hawes@lmco.com » Fri Jul 16, 2021 11:05 am

Good afternoon. I'm new to MD and SysML in general so I could be way off base in my approach.

I'm trying to model some aspects of a physical IT infrastructure (Computers, Switches, etc).
I have a pretty basic 'system' model that consists of Computer, Network Switch and other blocks as part properties. They are connected through ProxyPorts:
Screenshot 2021-07-16 130717.png


From this I can generate a Whitebox ICD table which I need to document how the system needs to be wired.
I also need to generate a more logical table that shows the 'active' components of the system (Computers, Switches) and bypasses the more 'passive' parts of the system (PatchPanels (PP) or I/O plates in a room).
So for the example above I would want to see
ES1/p1 -> C1/eth0
ES1/p2 -> C2/eth0
ES1/p3 -> C3/eth0
This type of table is needed to better show the switch configuration and allocation of ports to individual active components.

I've tried looking at Metachains to walk 'down' the connections but wasn't having any luck. I thought maybe adding a signal (LAN Data) to the active components would allow me to add a derived property but didn't have any luck there either.

Any ideas or thoughts would be appreciated
You do not have the required permissions to view the files attached to this post.
david.d.hawes@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Fri Jul 02, 2021 7:26 am

Re: Determine end-to-end connectivity over 'passive' parts

Postby ogirdor » Wed Jul 21, 2021 2:20 am

Hello David,

if you set the multiplicity of the derivedProperty to something like * then you get multiple results.

BR
ogirdor
Forum Beginner
Forum Beginner
 
Posts: 56
Posts Rating:17
Joined: Wed Jun 03, 2020 4:41 am

Re: Determine end-to-end connectivity over 'passive' parts

Postby david.d.hawes@lmco.com » Wed Jul 21, 2021 6:06 am

ogirdor wrote:if you set the multiplicity of the derivedProperty to something like * then you get multiple results.


I'm afraid I'm not following. How does setting multiplicity help me generate the type of table I'm looking for?
At a high level I'm trying to use the connectivity (in the diagram in my first post) that represents the physical cabling to generate/derive a table that represents the active components that are connected to the switch ports.. bypassing/ignoring things like the patch panels (PP) or other 'passive' bumps in the wire.
david.d.hawes@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Fri Jul 02, 2021 7:26 am

Re: Determine end-to-end connectivity over 'passive' parts

Postby ogirdor » Thu Jul 22, 2021 12:20 am

Oops, sorry, wrong thread. I think it should not be too difficult to solve your problem using a script. Maybe I can take a look at that later today.
ogirdor
Forum Beginner
Forum Beginner
 
Posts: 56
Posts Rating:17
Joined: Wed Jun 03, 2020 4:41 am

Re: Determine end-to-end connectivity over 'passive' parts

Postby ogirdor » Thu Jul 22, 2021 4:08 am

Hi David,

so this is what I could come up with. It is a script in a custom column (chosen language: Groovy). It defines a recursive function that is called anew for every port found, as long as the port has more than one connector attached. This script would fail to provide correct results if more than two connectors are attached to the port.

2021-07-22 ICDWithInBetweenPorts.IBD.png

2021-07-22 ICDWithInBetweenPorts.table.png

2021-07-22 ICDWithInBetweenPorts.CustomColumn.png


And this is the code:

Code: Select all
import com.nomagic.uml2.ext.magicdraw.compositestructures.mdinternalstructures.Connector
import com.nomagic.uml2.ext.magicdraw.compositestructures.mdports.Port

Port result
Port findOtherEnd (Port sPort,Connector incomingConnector=null){
        Connector theConnector
        Port theOtherPort
        if (sPort.getEnd().size() == 1) {
            theConnector = sPort.getEnd().getAt(0).getOwner() as Connector
            if (theConnector == incomingConnector){
                //this is the end of the chain
                return sPort
            } else {
                //now get the other end of the connector
                theOtherPort = theConnector.getEnd().find { it.getRole().find {r-> r != sPort } }.getRole() as Port
                return findOtherEnd(theOtherPort as Port,theConnector as Connector)
            }
        } else {
            //the port has more than one connector. Let's assume it's only two
            //find the other connector               
            theConnector = sPort.getEnd().find { !it.getOwner().is(incomingConnector) }.getOwner() as Connector
            //get the other port   
            theOtherPort = theConnector.getEnd().find { it.getRole().find { r->r != sPort } }.getRole() as Port
            return findOtherEnd(theOtherPort,theConnector)
        }
    }

return findOtherEnd(myPort,null)


BR
You do not have the required permissions to view the files attached to this post.
ogirdor
Forum Beginner
Forum Beginner
 
Posts: 56
Posts Rating:17
Joined: Wed Jun 03, 2020 4:41 am

Re: Determine end-to-end connectivity over 'passive' parts

Postby david.d.hawes@lmco.com » Thu Jul 22, 2021 2:46 pm

ogirdor wrote:Hi David,

so this is what I could come up with. It is a script in a custom column (chosen language: Groovy). It defines a recursive function that is called anew for every port found, as long as the port has more than one connector attached. This script would fail to provide correct results if more than two connectors are attached to the port.


Thanks!
I tried to capture this and for whatever reason it doesn't seem to be working the same way
Here is my updated table
Screenshot 2021-07-22 165445.png

The column "Interface Partner" is the custom column with your script. For some reason it is returning ports on the switch (which don't have any connectors to other ports on that switch)
The other custom columns are just metachains I made to try to figure out where the script and my model are out of sync.
The only thing I couldn't dive through was the 'find' path. Could that be where things are going off the rails?

Edit: The only other thing I can think of is that in my model the three PP's (1..3) are part properties all typed to the same "PP" block. Similarly C1/C2/C3 are part properties all typed to the same "Computer" block. Looking at your model you had each part property typed as a unique block type. Since (I think) the Ports are really properties of the Block finding the 'end' of that port would result in the Ends across all part properties (PP1..3 or C1..3) which probably throws off your script.
Specification window of the "PP1" part property.. shows all 'connectors' for all part properties of type 'PP':
Screenshot 2021-07-22 171240.png
You do not have the required permissions to view the files attached to this post.
david.d.hawes@lmco.com
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Fri Jul 02, 2021 7:26 am


Return to MagicDraw

Who is online

Users browsing this forum: No registered users and 1 guest