Book a Demo

Author Topic: Detect Interfaces Relations  (Read 5522 times)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Detect Interfaces Relations
« on: March 27, 2014, 10:38:31 pm »
Hello!

How can I detect programmatically if required interface is related to a real interface or it just has representation in diagram?  

I would like also to check the same about provided interfaces.

Thanks in advance!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Detect Interfaces Relations
« Reply #1 on: March 27, 2014, 10:59:46 pm »
Check if Classifier_guid is set.

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Detect Interfaces Relations
« Reply #2 on: March 27, 2014, 11:17:04 pm »
I have 2 required interfaces: one I related to an existing interface and the second not.  

I retrieved the required interfaces
Code: [Select]
ClassifierID from both of them and value is 0 at both.

Any ideas?

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Detect Interfaces Relations
« Reply #3 on: March 27, 2014, 11:41:44 pm »
Please make sure the interface is still set by clicking the "..." button in "Exposed Interface" dialog and checking if the selection points to the actual element in the model.

I tried in a simple script and the classifier information seems to be set OK, refer to output below.

Working on element 'Interface1' (Type=ProvidedInterface, ClassfierID=2340, Classifier Type=Interface)

Code
Code: [Select]
Session.Output( "Working on element '" & theElement.Name & "' (Type=" & theElement.Type & _
", ClassfierID=" & theElement.ClassifierID & ", Classifier Type=" & theElement.ClassifierType &")" )
« Last Edit: March 27, 2014, 11:43:01 pm by nizammohamed »

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Detect Interfaces Relations
« Reply #4 on: March 31, 2014, 06:39:51 pm »
Hello!

I would like to clarify myself:

I have a component.

Two Required (or provided) interfaces are owned by the component;
The first is related to an existing regular interface and the second not.

Even though the second one has representation on diagram, I would like to ignore him when I query for the component elements.  

Therefore, how can I distinguish between them?
I have no classifier_guid in API and Classifier_ID retrieves 0 for the 2 different interfaces.  

Thanks in advance!

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Detect Interfaces Relations
« Reply #5 on: March 31, 2014, 07:09:20 pm »
"first is related to an existing regular interface"

As stated in my previous post,

Please make sure the interface is set by clicking the "..." button in "Exposed Interface" dialog

If it is set this way, the ELEMENT.ClassifierID returns a non-zero value, as i showed in my script example

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Detect Interfaces Relations
« Reply #6 on: March 31, 2014, 07:53:24 pm »
Nizam is absolutely right. It's not sufficient to type the classifier name. It must be set using the ellipsis button.

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Detect Interfaces Relations
« Reply #7 on: April 01, 2014, 07:46:57 pm »
Thank you all!

Problem is solved:
 I was related it to interface as described, but then changed its name- which causes disconnection...

Thanks again.