Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Hurra on March 27, 2018, 07:52:11 pm

Title: SQL Search w model documents - only first element?
Post by: Hurra on March 27, 2018, 07:52:11 pm
Hello!

I use a SQL search to find my elements that I want in a table in my report.

I made it easy for me and put the desired elements in a diagram and my search has diagram name as input and lists all the elements on the diagram which was found:

Code: [Select]
SELECT o.ea_guid AS CLASSGUID, o.Object_Type AS CLASSTYPE, o.name AS Name, o.Note AS description
FROM (( t_object o
INNER JOIN t_diagramobjects do ON do.Object_ID = o.Object_ID)
INNER JOIN t_diagram d ON d.Diagram_ID = do.Diagram_ID)
WHERE d.name LIKE '#WC#<Search Term>#WC#'
ORDER BY o.Name ASC

The result is correct according to the SQL search/output window, however in the report, only the first element of that list is generated.

What am I missing?

Thanks!
Title: Re: SQL Search w model documents - only first element?
Post by: Geert Bellekens on March 27, 2018, 08:55:42 pm
What does the template look like?

Geert
Title: Re: SQL Search w model documents - only first element?
Post by: Hurra on March 27, 2018, 09:18:27 pm
package>
element>

table with Element.Name and Element.Notes

<element
<package
Title: Re: SQL Search w model documents - only first element?
Post by: Geert Bellekens on March 27, 2018, 09:39:36 pm
And you are using a model document with the search and this template?

Geert
Title: Re: SQL Search w model documents - only first element?
Post by: Hurra on March 27, 2018, 11:29:41 pm
And you are using a model document with the search and this template?

Geert

Yes. The search is selected through tagged values, and also search string specified.
Title: Re: SQL Search w model documents - only first element?
Post by: Geert Bellekens on March 28, 2018, 03:55:16 am
Weird. I'm not sure why it doesn't work.
I've used similar constructions in the past without issues.

Nothing in the template filters that is blocking some content?

Geert
Title: Re: SQL Search w model documents - only first element?
Post by: Hurra on March 28, 2018, 06:59:30 am
Weird. I'm not sure why it doesn't work.
I've used similar constructions in the past without issues.

Nothing in the template filters that is blocking some content?

Geert

Before I implemented the new diagram and SQL search I tried to get my elements of interest with filters... Ofc I forgot about that.

Thank you!

As an extra I can ask if this approach is considered "good". We have structured a stereotype with the dependency relation, depends on/needed by. If I only want the TOP element, can I create an SQL search to find all these elements but filter out the elements which only acts as source? The TOP element is never target I guess?

Thanks again Geert!