Forum Replies Created
-
AuthorPosts
-
DavidParticipant
Having a solution to this is very important. We are in the middle of a job and need to generate a nightly report that adds up the inherited values in the tagged values. The only way to do this right now is very manual. I found one query that gets us close to an answer. It gives the correct answer in EA. DocX seems to run a DISTINCT on the result which strips off the information we need. Here is the query that gives me a list of all of the parts and returns the CLASSGUID for the class that does have all of the correct tagged values:
SELECT aCls.ea_guid AS CLASSGUID, aPart.Name, aPart.Object_Type, aCls.Name
FROM t_object AS aCls INNER JOIN (t_package AS aPack INNER JOIN t_object AS aPart ON aPack.Package_ID = aPart.Package_ID) ON aCls.ea_guid = aPart.PDATA1
WHERE (((aPack.ea_guid)=’‘)); In “Find in Project” in EA I get the following results:
aPart.Name Object_Type aCls.Name
_____________________________________
part1Lt Part class1
part2Lt Part class2
part3Rt Part class2Notice that the last two entries will return the same CLASSGUID for class2. For some reason, DOCX will not show the tagged values for both of the class2 entries. In DocX I get the following:
ElementType Name TV1 TV2
________________________________
Class class1 25 30
Class class2 80 70Notice that I only received 1 class 2 result. This means that the duplicate CLASSGUID that DocX receives from the query is deleted from the results. Is it possible to allow the duplicate CLASSGUID to remain in the search result?
DavidParticipantIf the rule is use the local if it is set and the inherited if the local is not set, I do not require a local/inherited flag. It would be nice to have this to debug/understand the model, but it would not be required.
DavidParticipantOne work around is to let me run a SQL statement from Excel without filtering the data I get back. With a SQL I can ask for the Tagged values of the classifiers. The problem I have is if I have multiple parts pointing to the same class, the CLASSGUID filters out the duplicates (the two parts that point to the same value).
For example, the SQL
SELECT t_objectproperties.ea_guid AS CLASSGUID, aPart.Name, aPart.Object_Type, aCls.Name, t_objectproperties.Property, t_objectproperties.Value
FROM (t_object AS aCls INNER JOIN (t_package AS aPack INNER JOIN t_object AS aPart ON aPack.Package_ID = aPart.Package_ID) ON aCls.ea_guid = aPart.PDATA1) INNER JOIN t_objectproperties ON aCls.Object_ID = t_objectproperties.Object_ID
WHERE ((aPack.ea_guid)=’‘) AND (
(t_objectproperties.Property=’Power’) OR
(t_objectproperties.Property=’Weight’) OR
(t_objectproperties.Property=’Cost’))Will return the tagged value property and result(value). The Excel filter will not let me do this. It expects an
- This reply was modified 11 years, 2 months ago by David.
DavidParticipantIt seems like the SQL query does work in Excel if you do the following:
1) Put t_object.ea_guid AS CLASSGUID, as the first statement in the SQL SELECT
1.1) The ‘AS’ must be capital letters. A lower case ‘as’ will not work.
2) Only use the ea_guid out of the t_object table. It does not seem to work on other tables.DavidParticipantI can get searches that are built using the search builder found in EA to work. I can not get even the simplest searches built with SQL to work.
Also, In MS Word, the ‘EA Search” has
as an option and the package option. SQL Query does not. This seems strange. Do I have to create a custom query for every option I want put in my document? I would like to see the same two options for the SQL Query. Perhaps the MS Excel should have the same two search options (EA Search and SQL Query) as MS Word. Is this what is needed?
DavidParticipantI have created SQL queries that will remove the duplicates. Here is an example of one I created:
SELECT DISTINCT t_objectproperties.Object_ID AS ‘ID’, t_object.Name, t_object.ea_guid as CLASSGUID
FROM t_object, t_objectproperties
WHERE (t_object.Object_Type=’UseCase’ AND t_object.Object_ID=t_objectproperties.Object_ID AND (
((t_objectproperties.Property)=’Objective’) AND ((t_objectproperties.Value) Is Null) OR
((t_objectproperties.Property)=’Post Conditions’) AND ((t_objectproperties.Value) Is Null) OR
((t_objectproperties.Property)=’Preconditions’) AND ((t_objectproperties.Value) Is Null) OR
((t_objectproperties.Property)=’Trigger Stimulus’) AND ((t_objectproperties.Value) Is Null)
))Perhaps you can do something similar with your problem.
(Note, to write the more complicated SQL, I usually open the EA.eap file with MS Acess. I create the query using the design view.)
-
AuthorPosts
Download a free trial
Download eaTeamWorks today for several free for life features, plus no obligation, 30-day trials of all the products: eaDocX, ea Revision Manager, eaSheets, Model Expert and PortfolioManager. Discover for yourself why we sell the world’s best-selling Enterprise Architect extension.
Download