Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: harbourfish on May 26, 2010, 06:04:26 pm
-
:'([size=11]I'm developing a C# Add in. Now I need to list some field choices of a field. for example, there is a requirement item in Requirements Model package in EA. Double click the item, it will display some properties of the item. like Status, Difficulty, Priority and so on. I call them "fields".In these fields, they contains some field choices. As Status field, it contains "Approved", "Implemented", "Mandotory" and so on. So how could I get all these fields and their choices in my code?
Which methods provided by EA I could use to get all these information?
Thx in advanced.[/size]
-
Well, it depends.
If the values for those fields can be managed they are stored in the database. In that case you can get them either by using Repository.GetReferenceList() or by querying them from the database directly using Repository.SQLQuery().
Geert
-
Well, it depends.
If the values for those fields can be managed they are stored in the database. In that case you can get them either by using Repository.GetReferenceList() or by querying them from the database directly using Repository.SQLQuery().
Geert
_____________________________________
Thx.For the field named Status in the Property Page of a Requirement item metioned above, How to get the values of this field, Could you give me some code sample?
-
Can anyone show me the sample code. I just want get the information of the field named "Status", such as its type, its name and so on, and get all the values of it. Can anyone can show me? Thank you in advanced.
-
Have you tried Repository.GetReferenceList("Status")?
Geert
-
It seems "Status" is okay. But when I try to get the values of "Difficulty", error occurs. So how to get all the values of other fields, like "Difficulty", "Priority" and so on. It turns out a trouble for me.
-
Hi,
Have you looked at the API documentation regarding GetReferenceList()?
I don't see "Difficulty" as an allowed value, so no wonder you get an error.
As mentioned before, only the values that are managed in the database can be requested this way.
Other value types often are hardcoded.
Geert
-
Hi
The difficulty and priority fields are stored in the PDATA3 and PDATA2 fields in the t_object table.
HTH
-
Hi,
Have you looked at the API documentation regarding GetReferenceList()?
I don't see "Difficulty" as an allowed value, so no wonder you get an error.
As mentioned before, only the values that are managed in the database can be requested this way.
Other value types often are hardcoded.
Geert
----------------------------------------------
Okay. Thank you very much. I did realize most of these fields needs to be hardcoded if no other ways getting values of them, but I'm not sure about it.
-
Hi
The difficulty and priority fields are stored in the PDATA3 and PDATA2 fields in the t_object table.
HTH
-----------------------------
I call R.SQLQuery() to get the XML String. But I found that it only displays the specified value in a specified item. I think you make misunderstanding about it. What I want is that the difficulty field and priority field contain which values? I want to list all the optional values of one field.
-
Hi
In that case Geert is correct - these values dont appear in the DB
-
Hi
In that case Geert is correct - these values dont appear in the DB
-------------------------------
Anyway,Thank you very much.