Book a Demo

Author Topic: Getting the values of Complexity and Language  (Read 4996 times)

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Getting the values of Complexity and Language
« on: October 22, 2010, 08:05:46 pm »
Hi All

I have a need in an Add-In to obtain the current repository values for the following:

Complexity
Status
Language

I can obtain the values in Status by using the Repository method GetReferenceList("Status")

However what about the other two?

Yes I could "hard code" the values, but I am seeking a more elegant solution where I can obtain the Language settings (as shown in the code generation toolbar) directly from the repository, similarly with the Complexity.

If this is not possible, is there a way I can detect if the user has set the "Extend Complexity" option on?

This would allow me to use one of two "hard coded" settings if obtaining the values directly is not possible.

I have checked the EA version 8.0 User Guide and have examined the Enumerations but cannot find what I require there

Any suggestions?

Cheers

Phil
Models are great!
Correct models are even greater!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Getting the values of Complexity and Language
« Reply #1 on: October 22, 2010, 09:58:07 pm »
Phil,

You can find the "extended complexity" setting in the registry key HKEY_CURRENT_USER\Software\Sparx Systems\EA400\EA\OPTIONS\ComplexityEx

Complexity values can be found in t_complexitytypes

For languages, the only thing I found was
Code: [Select]
select distinct ProductName from t_datatypes
where type = 'Code'
But that might just be enough.

Geert

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Getting the values of Complexity and Language
« Reply #2 on: October 22, 2010, 10:31:54 pm »
Thanks Geert I did find the t_complexitytypes about 15 mins after my post, but thanks for the info regarding the windows registry setting

I will give the t_datatypes query a go,

Thnaks again
Models are great!
Correct models are even greater!

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Getting the values of Complexity and Language
« Reply #3 on: October 23, 2010, 12:44:08 am »
The query

SELECT DISTINCT ProductName FROM t_datatypes WHERE Type='Code'

works, but only returns a subset of the languages  :-[

That is

C#
C++
Delphi
Java
PHP
VBNet
Visual Basic

this is despite that fact that I have the Ultimate licence

I have found that the MDG Technologies appear to update the t-datatypes table upon loading, so I would expect to see languages like ADA for example. This is clear from the underlying XML since you can add your own language to the list by using an MDG

So where are these datatypes going?
Models are great!
Correct models are even greater!

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Getting the values of Complexity and Language
« Reply #4 on: October 23, 2010, 01:03:00 am »
Maybe they're not going into the database at all, but are simply updating some in-memory-list of languages from which the combo boxes are filled.

Which would mean that you have to parse the MDG xml file as long as Sparx doesn't provide access via API.