Author Topic: Traceability between EA and PTC Integrity  (Read 10897 times)

Raincloud

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Traceability between EA and PTC Integrity
« on: May 22, 2013, 10:58:38 pm »
Hi,

we want to create a connection between packages/ elements from Enterprise Architect and Integrity Items from PTC Integrity. The result should be that you choose a package/ element and you see the corresponding Integrity Item ID directly in EA (maybe a field like notes is filled with the information). In the Enterprise Architect you are able to find the GUID via Properties under the Project group or exporting the package to a xmi file and searching there the GUID.

My first question is, how unique is the GUID that no ID will appear twice or more, or how high is the probability of a same double GUID?

The next question is, which way would you suggest to read out this GUID? Are there any standard solution possibilities (for example using special workflows or user actions) available on EA side or is this only realizeable by a self-made program, implemented in C#? If the best choice is the program one, which sites could you suggest for that task or are there any "cooking recipes" how this task is solved the best way (and with less changes in EA to keep the tool running smooth as if nothing had been changed).

Thanking you in anticipation and sorry for that long "letter".


Regards
Dan

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: Traceability between EA and PTC Integrity
« Reply #1 on: May 22, 2013, 11:06:45 pm »
Quote
My first question is, how unique is the GUID that no ID will appear twice or more, or how high is the probability of a same double GUID?

LMGTFY

http://en.wikipedia.org/wiki/Globally_unique_identifier

as you can see there is a neglectable chance of two same GUIDs

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Traceability between EA and PTC Integrity
« Reply #2 on: May 22, 2013, 11:27:49 pm »
You get the GUID view context menu Copy from the project browser.

q.

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Traceability between EA and PTC Integrity
« Reply #3 on: May 23, 2013, 03:38:00 pm »
For interchanging data between appications there are two code options in EA - writing an external add-in (C# is one language you can use) or write an internal script using JavaScript or VBscript. See:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/automation_interface.html
For access to the GUID do a help search on ElementGUID  and also see the scripting examples.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Traceability between EA and PTC Integrity
« Reply #4 on: May 23, 2013, 04:23:19 pm »
Hi Dan,

Seems very doable to me.
If I were you I would write an add-in in C# to so.
I recommend using a tagged value to store the Integrity ID. Tagged Values are the standard way of extending elements with extra information.
If you are looking for info on how to create an add-in, I've written a couple of articles about that:
Tutorial: Create your first C# Enterprise Architect addin in 10 minutes
The complete Enterprise Architect C# add-in template
Testing and debugging your Enterprise Architect C# Add-in
Tutorial: Deploy your Enterprise Architect C# add-in with an MSI package

If you are looking for code samples you can find all of my code on github: https://github.com/GeertBellekens/

Regards

Geert

Raincloud

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Traceability between EA and PTC Integrity
« Reply #5 on: May 28, 2013, 12:43:05 am »
Hi Geert,

thx for your detailed answer. The add-in written in C# should be a great way to realize that task. I started to build the first EA addin but when I tried to add the registry key I didn't find the specific path in the Sparx Systems file tree. Do I have to create that file branch on my own and if so on which level shall I do this (the path on the system is):
 
Zero Level: Software
First Level: Sparx Systems
Second Level: EA400
Third Level: EA (with further levels) and SSCE

The next question is, how to check, if a file has been changed. I definitely use a time stamp to check, if that has been changed. The problem is, how high should the time difference be in the if condition and which field would you suggest to check. For example, if I use the modified field, nothing changes when changing or adding a tagged value in EA.


Furhtermore I ask myself, how the end user finds a specific EA item having only the GUID of it. For example, I see in integrity the special EA ID and ask myself where to find in EA. Is there a search mask where I enter that ID and EA shows the suitable package or package element or do I have to realize it that way that Integrity not only gets the GUID transferred but also a the name of the package or package part and a short path to find it.


Regards

Dan



Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Traceability between EA and PTC Integrity
« Reply #6 on: May 28, 2013, 01:24:01 am »
Hello,

an easy way is to install an Addin (e.g. Geerts Navigator). Then you can see it.

Best regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Traceability between EA and PTC Integrity
« Reply #7 on: May 28, 2013, 04:16:17 pm »
Dan,

Yes, you have to create the EAAddins key in the registry as well. The first addin you install will usually create the key.

Chapter 2 in my tutorial Tutorial: Create your first C# Enterprise Architect addin in 10 minutes deals with that.
Since version 8 or 9 (I forgot which one exactly) you can choose between adding a key in or [HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins] in [HKEY_LOCAL_MACHINE\Software\Sparx Systems\EAAddins]
(on 64 bit systems that sometimes becomes [...\SOFTWARE\Wow6432Node\Sparx Systems\EAAddins])

What do you mean by "if a file has changed"? It looks like you are more interested in knowing when an EA.Element has changed.
If you are trying to build an online (immediate) synchronisation, there are a few operations that you can implement to react on events from EA. Example: EA_OnNotifyContextItemModified

If you are persuing a more batch-like behavior, I would simply run through all elements and compare what's in EA with what's in the Integrity system.

With regards to selecting an element based on a GUID, you can use Repository.GetElementByGuid to get the element from the database.

Just last week I've implemented a new feature in my EA Navigator add-in that allows you to navigate from a GUID to the element in the project browser (also works for attributes, operations, diagrams,...)
It is still in beta, but you can download the installer here: EANavigator_Setup_v2.4.1.0_beta.msi
In the code you can find the implementation in Model.cs in the operation getItemFromGUID (line 569)

Geert