Book a Demo

Author Topic: How to retrieve note link to connector  (Read 4817 times)

beginner

  • Guest
How to retrieve note link to connector
« on: June 15, 2010, 01:58:28 am »
Does anyone have an idea where to find the note links attached to connectors? The note does not have a connector itself. So I suppose it's somewhere in t_xref. But I could not find the note's GUID.

b.

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.<Pogo, 1970>
    • View Profile
Re: How to retrieve note link to connector
« Reply #1 on: June 15, 2010, 06:31:44 am »
Zarquon says-

It looks like the note link is stored in t_object in column PDATA4 in the row for the Note object itself as "idref1=<Connector ID for the first linked connector>;idref2=<Connector ID for the second linked connector>," etc.

Fred W
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to retrieve note link to connector
« Reply #2 on: June 15, 2010, 04:27:16 pm »
Or "How NOT to build a relational database" :o

Geert

beginner

  • Guest
Re: How to retrieve note link to connector
« Reply #3 on: June 15, 2010, 04:37:55 pm »
Thanks from the Great Handkerchief. I'm sorry that there are still some Jatravartids left in  Australia working on a strange database with 50 extensions.

b.

P.S. it appears that in this very case MiscData is not populated with PDATA. JAEAB (just another EA bug). I will have to use SQL...
« Last Edit: June 15, 2010, 05:00:52 pm by beginner »

fwoolz

  • EA User
  • **
  • Posts: 435
  • Karma: +0/-0
  • We have met the enemy, and he is us.&lt;Pogo, 1970&gt;
    • View Profile
Re: How to retrieve note link to connector
« Reply #4 on: June 16, 2010, 12:08:44 am »
Bless you.
Fred Woolsey
Interfleet Technology Inc.

Always be ready to laugh at yourself; that way, you beat everyone else to the punch.


mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: How to retrieve note link to connector
« Reply #5 on: June 18, 2010, 12:13:35 pm »
Quote
P.S. it appears that in this very case MiscData is not populated with PDATA. JAEAB (just another EA bug). I will have to use SQL...

Um no, it does seem to be populated correctly. Try this script:

Code: [Select]
/*
 * Script Name: Link Test
 * Author: mfraser
 * Purpose: To prove that the automation interface isn't broken in this case
 * Date: 2010-06-18
 */
function main()
{
      // {6ED50893-BACF-4e1e-A255-119C4D0B9D04} is the GUID of my linked note
      var theElement as EA.Element;
      theElement = Repository.GetElementByGuid( "{6ED50893-BACF-4e1e-A255-119C4D0B9D04}" );
      
      // Misc data is 0 based so PDATA4 == MiscData(3)
      Session.Output( "[" + theElement.MiscData(3) + "]" );
}

main();

Which raises 2 questions:
1. Which element are you inspecting PDATA4 on: the Note or the Connector (should be the note)
2. Are you taking into account that MiscData is zero based?
« Last Edit: June 18, 2010, 12:19:04 pm by mfraser »
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

beginner

  • Guest
Re: How to retrieve note link to connector
« Reply #6 on: June 18, 2010, 09:14:27 pm »
As I wrote to Allan, it is (likely) Perl/EA communication which is causing the trouble. MiscData is undef in all cases. There had been a workaround for GetTreeSelectedObject which was behaving differently for interpreter languages. I can't recall other places where arrays are returned, just scalar values. So the array handling might be wrong.

b.

beginner

  • Guest
Re: How to retrieve note link to connector
« Reply #7 on: July 09, 2010, 05:18:48 pm »
Just as a blog entry: it appears that sometimes PDATA4 contains zombie entries. That is PDATA4="idref1=59255;" where 59255 is not in the database.  I ran consistency check several times but the zombie remained. JAEAB

b.