Author Topic: Model search scripts: How to access search term?  (Read 4441 times)

rayt

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Model search scripts: How to access search term?
« on: June 05, 2012, 08:46:24 pm »
Hello

I'm trying to write a model search script (from doc: Scripts that can be executed as model searches; these scripts are listed in the Search field of the Model Search window, in the last category in the list)

How do I access the entered search term from inside the script? I found no hints in the template demo script or in the docs.

Thanks in advance for your tips.
Ray

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model search scripts: How to access search ter
« Reply #1 on: June 06, 2012, 05:18:37 pm »
Isn't that the same as with Add-in Searches?
There the search term is passed as a parameter to the search operation.

Geert

rayt

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Re: Model search scripts: How to access search ter
« Reply #2 on: June 06, 2012, 06:59:37 pm »
EA creates a template for a search script like this:

Code: [Select]
   ..
function OnSearchScript() {
       ..
}
    ..
OnSearchScript();

So it looks like no function is called, but the file is executed when the search is run.
I've got no clue how the search term could be passed into the file.

Cheers,
Ray

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Model search scripts: How to access search ter
« Reply #3 on: June 06, 2012, 07:28:58 pm »
You better ask support then, I wouldn't know either.

Geert

rayt

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Re: Model search scripts: How to access search ter
« Reply #4 on: June 06, 2012, 08:02:55 pm »
Thanks Geert, will do so
I'll post here when I find out more.
Ray

rayt

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Re: Model search scripts: How to access search ter
« Reply #5 on: June 13, 2012, 02:34:29 am »
A little update: This is a known limitation, it'll get added in a later release.

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: Model search scripts: How to access search ter
« Reply #6 on: June 14, 2012, 03:38:32 am »
Hi Ray,

Just in case this is an acceptable alternative: you can always ask the user for the search term. See below for eg vbscript.

Paulus

Code: [Select]
           dim answer
            answer = InputBox("Prompt","Title","Default")
            Session.Prompt answer,promptOK
« Last Edit: June 14, 2012, 03:39:38 am by pmaessen »

rayt

  • EA User
  • **
  • Posts: 28
  • Karma: +1/-0
    • View Profile
Re: Model search scripts: How to access search ter
« Reply #7 on: June 15, 2012, 01:27:07 am »
Thanks Paulus. Until search term access is available, I'll use this as a fix.
Ray