Book a Demo

Author Topic: EA.ConnectorEnd.IsNavigable sometimes wrong  (Read 4913 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
EA.ConnectorEnd.IsNavigable sometimes wrong
« on: June 26, 2016, 05:30:55 pm »
When setting the navigability using the direction field on the association the navigability in the EA.ConnectorEnd is not reported correctly.

This is probably due to the fact that EA stores this information in two places (t_connector.DestIsNavigable and t_connector.DestStyle).
When setting the navigability with the direction field only the DestIsNavigable is filled in where the DestStyle remains Navigable=Unspecified;

When setting the navigability with the Role field then the opposite is true, DestIsNavigable remains 0 where DestStyle gets filled in with Navigable=Navigable;

In the first case the EA.ConnectorEnd.IsNavigable and EA.ConnectorEnd.Navibility fields are not filled in correctly.

Bug reported

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: EA.ConnectorEnd.IsNavigable sometimes wrong
« Reply #1 on: June 27, 2016, 08:50:33 am »
I thought I got someone to change that in the documentation to deprecated years ago.

Use Navigable instead, the other is a BOOL value, which isn't able to handle a tri-state value.

To my knowledge, the field behind that automation value has never been used by EA.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: EA.ConnectorEnd.IsNavigable sometimes wrong
« Reply #2 on: June 27, 2016, 09:55:48 am »
And I know that property has been marked with 'This property is not used' in bold since at least September 4th 2015 (which is the 'Modified' stamp on the procedure) and very probably a long time prior to that as well.  'Deprecated' might not be the best term to use, since it implies that the property has been in use but has now been replaced by something else, whereas Simon pointed out that the property has never been used in EA.
Best Regards, Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA.ConnectorEnd.IsNavigable sometimes wrong
« Reply #3 on: June 27, 2016, 01:19:32 pm »
And still, if you set the direction using the Direction (Source > Destination) EA will only store this info in t_connector.IsNavigable and not in c_connector.DestStyle. (remains unspecified).

At that point the API reports the Navigability to be "Unspecified" which is clearly wrong.

I'm building a quite elaborate workaround in my code to get the correct info from the database now.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA.ConnectorEnd.IsNavigable sometimes wrong
« Reply #4 on: June 27, 2016, 01:55:58 pm »
For those interested, here's my workaround:

Code: [Select]
public bool isNavigable {
  get {
//because of a bug in the API we don't alwas get the correct information. Therefore we need this workaround using a database call
string sqlGetNavigability = "select c.DestIsNavigable, c.DestStyle, c.SourceIsNavigable, c.SourceStyle from t_connector c where c.ea_guid = '"
+ this._association.uniqueID +"'";
var navigabilityInfo = this.model.SQLQuery(sqlGetNavigability);
XmlNode navigableNode;
XmlNode styleNode;
if (this.isTarget)
{
navigableNode = navigabilityInfo.SelectSingleNode(this.model.formatXPath("//DestIsNavigable"));
styleNode = navigabilityInfo.SelectSingleNode(this.model.formatXPath("//DestStyle"));
}else
{
navigableNode = navigabilityInfo.SelectSingleNode(this.model.formatXPath("//SourceIsNavigable"));
styleNode = navigabilityInfo.SelectSingleNode(this.model.formatXPath("//SourceStyle"));
}
if (navigableNode != null && navigableNode.InnerText == "1")
{
return true;
}
if (styleNode != null && styleNode.InnerText.Contains("Navigable=Navigable"))
{
return true;
}
//end of workaround
return this.wrappedAssociationEnd.Navigable == "Navigable"
|| this.wrappedAssociationEnd.IsNavigable; }
}

This now seems to work correctly

Geert