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 - Viking

Pages: 1 ... 3 4 [5] 6 7 ... 18
Thank you, DarrenDickens. Good points.

Java and JavaScript are not similar.

Hello together,

I am looking for possibilities to access the Sparx API from "outside". I want to run "scripts" in Java, Visual Basic or something else (that works) and manipulate content in EA via the Sparx API. So to say I want to run a script which also could be excecuted inside EA. Most welcome would be Java inside Eclipse as container.

The database for our EA environment is MSSQL-server. I saw a lot of possiblities to access EA (e.g. Scripting Enterprise Architect, from there I used the subject-title). But these possibilities are EAP-based and sometimes I have the impression, that they are outdated (e.g. I did not find a complete example using Java API).

Are there any summaries available?

Many thanks in advance, V.

You can also run VBScript outside of EA, but then you'll have to create the Repository as I showed you here.
When running inside EA it is added to the context for you by EA.
The code in VBA or VB is almost exactly the same.


Thank you, Geert. I get an Microsoft VBScript runtime error "ActiveX component can't create object: 'EA.Repository'". That's why I was asking, if I have to link EA.tlb (or something else) and if can access EA via VBS from a DOS-box.

Another question is, if I can access EA from Ecplise and Java. I read an anwser from Simon and my understanding is that he said, that the EA-API is not accessible from Eclipse.

Best regards, V.

Do you want to use VB, or VBScript?

The key to connecting to the running instance in a VBScript is to use the following:

Code: [Select]
    dim repository
    set repository = CreateObject("EA.Repository")

An example of VB(A) using EA is to be found in my Excel importer:


I want to access EA from outside. My understanding is that VBScript does only make sense for Scripting inside EA. We are not allowed using MS Script Debuger. That's why we are looking for alternatives.


I refer to

I never used Visual Basic in my life. I want to access EA via VB. I do not want to install a tool. So I want to run it (with cscript) from a DOS-box.

The document mentioned above says that I have to use "Enterprise Architect Object Model" resp. EA.tlb. Can I link this library inside the script or as part of the cscript-command. Probably this is more a VB question. I hope that somebody can tell me the solution anyway.

Many thanks in advance, V.

How is EA setup on your machine? -> it's getting installed via DSM.
Is it installed locally? -> yes.
What operating system are you running? -> Win 7 Enterprise
You mentioned "The script works fine in another environment". What other environment? -> private computer with Win 10.
Was this an installation of EA on another PC? -> yes.
Any differences you are aware of between these installations? Win 7 vs Win 10. The EA with problems has been installed by
What version of EA is installed? -> V13
Is it the same as yours? -> Yes.
Were they both installed the same way? -> No. IT department (with problems) vs. me.
For example - if your EA was setup using the "Zero Configuration Client" method described on the following page, scripting will not work. See: -> no

Isn't there any way to find out how EA has been installed and which features has been installed?

Another solution would be to replace MS Script Debugger with a supported component.

Any ideas ?  :)

Usage of println() would probably depend on the Javascript engine that you are using. The engine that EA uses is based on Mozilla SpiderMonkey (version 1.8 I think), which doesn't seem to know about this function.

The equivilent in EA would be to call Session.Output().  E.g. Session.Output("test");

If you like the style of having println() in your code though, you could just write a little wrapper function like this:

Code: [Select]
function println(message)

EA still says "Session undefined".

[78862640]      Stack recording threshold set to 3 frames
[78862716]      Default Directory is C:\Program Files (x86)\Sparx Systems\EA
[78862716]      Agent dll found: C:\Program Files (x86)\Sparx Systems\EA\vea\x86\SSScriptAgent32.DLL
[78862716]      Default Directory is C:\Program Files (x86)\Sparx Systems\EA
[78862717]      Agent: Started
[78862768]      Session is undefined

Hi, because I am not allowed to use MS Script debugger (out of MS-support), I wanted to switch to Javascript. To test the environment I tried a simple script (see below), but EA says, that println is not defined. The script works fine in another environment.

function main() {

So my question is, what are the prerequisites of JS? Can it be disabled and how? Many thanks in advance, V.

Automation Interface, Add-Ins and Tools / Re: Data Modeling
« on: May 15, 2017, 09:13:39 pm »
1) When you create a table, before you can create columns you need to tell EA what DBMS you are modelling. EA is not opening a database connection, it's just trying to find out what you're doing.
2) The list of available types will depend on the DBMS you are modelling. That's why you need to let EA know.
3) Right-click a package in the Project Browser, Add Diagram, Select From: Extended, Diagram Types: Data Modeling. If Extended isn't available, open the MDG Technologies dialog and enable "Core Extensions".
Thank you very much. Very helpful.

Automation Interface, Add-Ins and Tools / Re: Data Modeling
« on: May 15, 2017, 09:12:36 pm »
This is really a database model or at a pinch a physical data model.  The answer to your question all depends on what sort of data model you want to produce.  You can easily produce a conceptual data model using a class diagram.
Yes, at the beginning I wanted to switch to UML class model. Than I found Data Modeling and liked the elements like Table and Function. Actually it is based on UML Class Diagram. What would you prefer, Data Modeling or UML Class and why?

Automation Interface, Add-Ins and Tools / Data Modeling
« on: May 15, 2017, 02:49:49 am »
Hi together,
It seams to me that Toolbox > Data Modeling has change since I used it the last time.
(1) If I want to add properties with F9, it opens a database-connection. Can I turn this off?
(2) If I want to add columns, the type has to be a VarChar. Is that a bug or a feature?
(3) The documentation says, that there is a diagram available for this notation "Click on Extended > Click on Data Modeling". I cannot find this. How can I assign this diagram type to my diagram?
(4) Normally I use Chen, but prefer Data Modeling in the meantime. Am I wrong using this notation for modelling databases?
Many thanks in advance, V.

1) Yes. The manual "Link to element feature". The API does not provide that directly. So you need to investigate what EA is doing in that case (forgot the details, sorry).q.
Very helpful. Thank you very much.

Pages: 1 ... 3 4 [5] 6 7 ... 18