Book a Demo

Author Topic: Model Search for Multiple Terms  (Read 7341 times)

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Model Search for Multiple Terms
« on: April 10, 2009, 11:06:05 am »
I'm trying to run a Model Search using the Simple search, for multiple terms.  I'd like to find the three elements called Element1, Element2 and Element3.

I'm trying to just comma separate the values in the Search Term field, but that doesn't work.  How do I do this please?

Thanks.
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model Search for Multiple Terms
« Reply #1 on: April 10, 2009, 03:20:57 pm »
If you really need this you can always use the SQL search.
something like
Code: [Select]
select c.ea_guid as CLASSGUID,c.object_type as CLASSTYPE,c.name as Name, c.stereotype as Stereotype
,package.name as 'Package Name'
from t_object c
join t_package as package on (c.package_id = package.package_id)
where
c.name like 'Element1'
or c.name like 'Element2'
or c.name like 'Element3'
You would then need to change "Element1", "Element2" and "Element3" for what you are looking for.
And if you really really need this you can surely parse the different parts from the comma separated <Search Term> and look for those seperately. Then you could enter a comma separated list in the search box and you don't have to worry about the SQL code. But I leave that excercise to someone else. ;)

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Model Search for Multiple Terms
« Reply #2 on: April 10, 2009, 05:01:32 pm »
In model search you can enter only one term through imput, but you can try a SQL search with an "where in" in it and then in one parameter you can pass a list of terms.
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model Search for Multiple Terms
« Reply #3 on: April 10, 2009, 05:25:24 pm »
I'm afraid that isn't going to work.
You get an error about invalid columns because your search terms are not enclosed in quotes.
i've tried to add the quotes in the search field, but those get stripped off by EA before the query is submitted.
No, I'm afraid some fancy combination of string functions will need to do the trick.

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Model Search for Multiple Terms
« Reply #4 on: April 11, 2009, 02:33:39 am »
Thanks for your help Geert, but when I copy and paste your query and run the search, I get this error:

DAO.QueryDef [3131]
Syntax error in FROM clause.

Any ideas please?  Thanks!
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Model Search for Multiple Terms
« Reply #5 on: April 11, 2009, 02:36:56 am »
maybe the parenthesis?
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Model Search for Multiple Terms
« Reply #6 on: April 11, 2009, 02:43:59 am »
Thanks Martin, I tried removing them, but that didn't work...
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Model Search for Multiple Terms
« Reply #7 on: April 11, 2009, 02:51:12 am »
maybe just moving the first one right after the "join". I'm not sure about it, but it works with Access, and it makes problems with the "joins" and parenthesis...
Recursion definition:
If you don’t understand the definition read "Recursion definition".

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Model Search for Multiple Terms
« Reply #8 on: April 11, 2009, 03:04:40 am »
Tried this, still getting the same error unfortunately:

select c.ea_guid as CLASSGUID,c.object_type as CLASSTYPE,c.name as Name, c.stereotype as Stereotype,package.name as 'Package Name'
from t_object c
join (t_package as package on c.package_id = package.package_id)
where
c.name like 'Element1'
or c.name like 'Element2'
or c.name like 'Element3'
« Last Edit: April 11, 2009, 03:05:47 am by dworkman »
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model Search for Multiple Terms
« Reply #9 on: April 11, 2009, 04:22:20 am »
Oh, sorry, that was a query for sql-server.
I'll try to translate it to the crippled sql syntax of Access and get back to you.

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Model Search for Multiple Terms
« Reply #10 on: April 11, 2009, 04:26:50 am »
Actually one of our developers here helped me, and I got it working!

Thanks Geert!

select
  t_object.ea_guid AS CLASSGUID,
  t_object.object_type AS CLASSTYPE,
  t_object.name,
  t_object.stereotype,
  t_package.name
from
t_object inner join t_package
on (t_object.package_id = t_package.package_id)
where
(object_type) = 'Requirement'
and (UCase(t_object.name) like '*BR: ACH/NOC PROCESSING*'
or UCase(t_object.name) like '*BR: ACCOUNT DISPLAY*')
« Last Edit: April 11, 2009, 09:18:45 am by dworkman »
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model Search for Multiple Terms
« Reply #11 on: April 11, 2009, 04:38:23 am »
This one works in Access as well.
Apparently Access doesn't like JOIN statements; how typical  :-/
Code: [Select]
select c.ea_guid as CLASSGUID,c.object_type as CLASSTYPE,c.name as Name
, c.stereotype as Stereotype
,package.name as 'Package Name'
from t_object as c,t_package as package
where
c.package_id = package.package_id
and (c.name like 'Element1'
or c.name like 'Element2'
or c.name like 'Element3' )

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Model Search for Multiple Terms
« Reply #12 on: April 11, 2009, 05:38:50 am »
Thanks for all your help Geert.
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model Search for Multiple Terms
« Reply #13 on: April 11, 2009, 05:39:20 am »
Look like our replies crossed each other.
I'm happy you found a working solution.

Geert

Dorian Workman

  • EA User
  • **
  • Posts: 194
  • Karma: +0/-0
    • View Profile
Re: Model Search for Multiple Terms
« Reply #14 on: April 11, 2009, 05:56:39 am »
You may like to know that my friend who helped me is also Belgian.   :)
<a href="http://www.linkedin.com/in/dorianworkman" ><img src="http://www.linkedin.com/img/webpromo/btn_liprofile_blue_80x15.gif" width="80" height="15" border="0" alt="View Dorian Workman