Book a Demo

Author Topic: API to get Sparx EA version  (Read 6446 times)

hata

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
API to get Sparx EA version
« on: September 24, 2014, 05:53:38 pm »
When I create the tagged value with datetime type, I see it store value in t_objectproperties as "MM/dd/yyyy" with Sparx 10 but with Sparx 11 the value is "dd/MM/yyyy". So that when I get the tagged value with datetime type to parse it by DateTime.Parse(value), the error will throw invalid format in Sparx 11. My Add-in must support both version, I have to workaround by check version of Sparx to use corresponding format. Please help me about the API to get Sparx EA version, please let me know if you have other solution

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: API to get Sparx EA version
« Reply #1 on: September 24, 2014, 06:33:36 pm »
You can use Repository.LibraryVersion, but I'm not convinced that will solve the issue.
What with dates that have been encoded in v10 but are not used in v11?
I'm pretty sure EA will not change all existing values in the database upon upgrading.

Geert
« Last Edit: September 24, 2014, 06:33:52 pm by Geert.Bellekens »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: API to get Sparx EA version
« Reply #2 on: September 24, 2014, 07:05:21 pm »
This is likely a rendering and not a storage issue.

q.

hata

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: API to get Sparx EA version
« Reply #3 on: September 24, 2014, 07:39:15 pm »
Quote
You can use Repository.LibraryVersion, but I'm not convinced that will solve the issue.
What with dates that have been encoded in v10 but are not used in v11?
I'm pretty sure EA will not change all existing values in the database upon upgrading.

Geert

Thanks for your reply, I create a new the tagged with detail as "Type=DateTime; BaseStereotype=ArchiMate_WorkPackage,ArchiMate_Deliverable,ArchiMate_Plateau; ", after set value for tagged by date picker, I get the value from tagged as "dd/MM/yyyy" in version 11. I don't set any locale or encoded for the tagged, the same code, the same machine, but error throw in version 11, please let me know if you have better solution :)

hata

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: API to get Sparx EA version
« Reply #4 on: September 24, 2014, 07:51:13 pm »
Quote
This is likely a rendering and not a storage issue.

q.
I don't render UI to display, I see the value store in t_objectproperties when I use Edit->Find In Project tool to query it, the query is "select * from t_objectproperties where Property="myProperty"

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: API to get Sparx EA version
« Reply #5 on: September 24, 2014, 08:44:04 pm »
You need to report a bug here. I have created a TV in V10 and V11. And indeed they store it differently:



q.
« Last Edit: September 24, 2014, 08:44:29 pm by qwerty »

natvig

  • EA User
  • **
  • Posts: 65
  • Karma: +7/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: API to get Sparx EA version
« Reply #6 on: February 09, 2015, 08:45:19 pm »
I believe this issue is even more complicated. I have two different installations of EA version 1112, on two separate computers both running Windows 7. The Windows region settings are identical on both computers. The dates stored in t_objectproperties table is 26/02/2020 on one of my computers, and 2020-02-26 on the other.

/Hans