Book a Demo

Author Topic: Object Instance Name in Communication Diagram  (Read 9731 times)

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Object Instance Name in Communication Diagram
« on: January 14, 2017, 06:02:17 am »
I'm using EA13 build 1307 with a local EAP file.  I have a number of VB scripts that extract data from the architecture model to use for analysis.  One of the scripts is used to access data associated with connectors.

When I run the script on UML Communication diagrams (such as OV-2 Resource Flow Diagrams), I have connector target or source elements showing up in the data extraction with no Name.

My diagrams have Class Instances (such as the class is "Crew Station" and the object instance is "Commander:Crew Station") and Actor instances (such as the Actor is "Commander" and the object instance is ":Commander").  There are Association interfaces between the class and actor instances.  When I manually bring up the properties of the Association connector, the connector side attached to the actor instance is blank (no name).  When I select the interface between the "Commander" actor and the "Commander" crew station, right click and choose "Advanced", "Set Source and Target", the From Element listed is ":Commander" and the To Element listed is "Commander:Crew Station".

Without changing the names of the actor object instances to have something in front of the ":", is there anyway using a script to get to the equivalent of the Advanced "Set Source and Target" elements so that I will have an element name for the "Commander" actor rather than a blank?  Right now, the element names are obtained using the connector "SupplierID" and "ClientID" properties to "GetElementByID".  From there, the element "Name" is selected.  The element IDs are not blank.

Thank you for any assistance you can provide.

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #1 on: January 14, 2017, 08:27:02 am »
Hard to digest that was. Just use Element.ClassifierName and if you are interested in details Element.ClassifierID (for which you need to call Rep.GetElementByID).

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #2 on: January 14, 2017, 09:09:48 am »
The "classifier name" did not work - I still get blank values.  Part of my script writes data to the System Output window so that I can check what information I get.  For the example I had, some of the information written is as follows:

  Connector ID:  12142
  Diagram ID:  908
  Sender Name:
  Sender Classifier Name:
  Sender ID:  11199
  Receiver Name:  Commander
  Receiver Classifier Name:
  Receiver ID:  29816
  Connector Type:  Association
  Connector Direction:  Unspecified

The "sender name" should somehow report out the "Commander" actor instance.  The "receiver name" reports out the "Commander:CrewStation" class object instance.

Gayle

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #3 on: January 14, 2017, 09:22:11 am »
The Classifier Name idea got me looking around for other possibilities and I can get the Fully Qualified names for both the actor instance and the class object instance:

  ISP Model._Common Elements.Actors.Crew Station Actors.Crew Station Actors.:Commander
  ISP Model._Common Elements.Architecture.Crew Station Arch.Crew Station UCD Arch.Commander: Crew Station

While this is not the short name that I would prefer, I think I can make it work.  If anyone has any other possible solutions, I would appreciate the ideas.

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #4 on: January 14, 2017, 07:31:41 pm »
TL;DR The ClassifierID is the elementId of the object that is used as classifier. Namely when you create an instance or when you use Ctrl-L on an instance. When you retrieve that element you get the part after the colon. So for a lifeline that reads "name:Classifier" the "name" is that of the lifeline. And its classifierId will point to an element whose name is "Classifier".

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #5 on: January 17, 2017, 03:08:34 am »
Unfortunately in the architecture model, the ClassifierID (part before the colon) is blank for the actor instances.  I was trying to find a way around the fact that we have only " :Name" labels on the actor instances.

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #6 on: January 17, 2017, 05:20:48 am »
The classifier specifies the part AFTER the colon.

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #7 on: January 17, 2017, 06:09:51 am »
Yes, thank you.  I got it backwards.

All of my attempts have been unsuccessful, except to use the fully qualified name.

I have two examples:
  Actor instance:  ":Commander"
  Class object instance:  "Commander:CrewStation"

The "GetConnectorByID" was executed to access the connector data.  From there, the two elements were accessed using "GetElementByID".  When looking at each element using the Element information:

  Actor Instance:  Name is blank, Classifier name is blank, FQ name is "ISP Model._Common Elements.Actors.Crew Station Actors.Crew Station Actors.:Commander"
  Class object instance:  Name is "Commander", Classifier Name is blank, FQ name is "ISP Model._Common Elements.Architecture.Crew Station Arch.Crew Station UCD Arch.Commander: Crew Station"

Note that these are not lifelines (from Sequence diagrams), but are instances that appear on a Resource Flow Diagram (OV-2).  The lifelines in the related sequence diagrams use the same source Actor and Class, so messages in the two diagrams are synchronized.

I still think I'm missing something, but so far, I've been unsuccessful in my tests.  I would like the actor instance to be ":Commander" and the object instance to be "Commander:CrewStation", but I don't seem to be able to access the portion of the names after the colon.

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #8 on: January 17, 2017, 07:36:44 am »
Could you cut this to a single example, please? When you select ":Commander" and press Ctrl. Which instance does it show? Also for "Commander:CrewStation". The element highlighted in the Ctrl-L dialog are the classifiers you will find when retrieving ClassifierID for each. Please verify that also programmatically. Then from that point on, try to explain your issue.

q.

Gayle

  • EA User
  • **
  • Posts: 37
  • Karma: +1/-0
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #9 on: January 17, 2017, 08:08:09 am »
Problem solved.  What I was missing was that once I had the "ClassifierID" (not ClassifierName"), I needed to use the GetElementByID to get the name of the classifier element. 

Thank you for the assistance.  I apologize for making not being able to clearly state the problem.

Gayle

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Object Instance Name in Communication Diagram
« Reply #10 on: January 17, 2017, 10:39:18 am »
I also banged my head more than once on a door post before realizing what I was doing wrong.

q.