Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Adler

Pages: [1]
1
Hi,

and thanks to all for the suggestions.

@qwerty
I assume that by "traversing the package tree" you mean something like a couple of nested while loops for checking the whole model entity-by-entity. If so, then id like to avoid that if possible. In bigger models this could become kind of messy. For searching I find that expression-based solutions like SQL or XPath look a lot better in code. But of course its a potential solution and also a matter of personal preference I think.
 
@Geert
That sounds promising, but I'm a bit confused. The EA help file says about the SQLQuery method:

"Enables execution of a SQL select statement against the current repository"

So I assume that there is a "Repository" table somewhere in the guts of the EA, try:

dim container
container = Repository.SQLQuery("SELECT * FROM Repository;")

and get the error message:
"... cannot find input table or query 'Repository' ... "

Are there any preparation steps to do before I can apply the SQLQuery?

@Simon M
Yes, the GetElementsByQuery is a useful method for fast searches. But as qwerty says, the problem about the element name is that its not unique. So I'd prefer something that allows me to include further parameters (package names, diagram names or maybe even stereotypes and attribute values) into my searching expression.



2
Hell Community,

is there a way access elements and diagrams by their name in scripts?

I have checked the Repository class but it only seems to offer ways to access the elements by the id resp.  uuid.

Greetings
Adler

3
Automation Interface, Add-Ins and Tools / Re: import/export txt files
« on: September 30, 2013, 10:44:54 pm »
First, thanks a lot for your helpful replies.

The final solution for my problem is much more simple. I have browsed the EA local scripts and found a "File IO Example" script, which is have copy-pasted into an own script (since local scripts can not be altered) and adjusted to my own needs. Also, johann's link
(http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1369750172)
was handy.

The local scripts seem to be a nice starting point for straight forward solutions for EA-newcomers.

Greetings
Adler

4
Automation Interface, Add-Ins and Tools / import/export txt files
« on: September 21, 2013, 01:20:20 am »
Hello dear community,

is it possible to read and write simple .txt files in scripts executed directly in the EA? As far as i see its generally possible to import source code files and to export RTF documents, so the basic functionalities for reading and writing txt file seem to be available. But i cant find an appropriate method in the EA/Repository/Session.

I'm aware that i can access the EA model data from other applications and thus use the parsing capabilities of C++ or Java. But i would prefer to stick to EA scripting to get an all-one-tool solution.


Pages: [1]