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 - Geert Bellekens

Pages: 1 ... 7 8 [9] 10 11 ... 531
General Board / Re: EA.Interop C#: Return values of methods at failure?
« on: February 02, 2018, 09:08:09 pm »
This method used to throw an exception when it couldn't find the correct ID, but recently (I think in version 12) they have changed that behavior to returning null.
I remember because it caused a bug in my add-ins as they were counting on the exception, and not the null.

The best way to be sure is by trying it out in the version you are targeting.

It would indeed be nice if that behavior would be documented.


Bugs and Issues / Re: Formatted fields in SQL Fragments
« on: February 02, 2018, 03:55:14 pm »
It works, but you have to tailor your query to the database you are using.


Hi Silvain,

The script you are starting from uses the EAAddinframework as you noticed.
So that means you are no longer programming against the EA API, but against the library of wrappers I wrote.

The relatedElement you get as a parameter is coming from connector.relatedElements, which returns hashmap of UML.Classes.Kernel.Element (see ConnectorWrapper)

The Element interface does not define a property Stereotype but it does have a property called stereotypes, a hashmap of Stereotypes. So before using that in VBScript you'll have to convert that to an ArrayList like we did with the RelatedElements (generics cannot be used in VBScript)

Then you can iterate the list of stereotypes and check the .name property.

Alternatively you can rely on the properties and operations of the Element class, which is the parent class of almost all classes in the EAAddin framework.
That class defines an operation to test for a specific stereotype:
bool HasStereotype(string stereotype)
and also a list of stereotype names
List<string> stereotypeNames which you have to convert to an ArrayList again before being able to use it.

Hmm, explaining it like that makes it look very complicated doesn't it :-[ I didn't really intend the library for usage in scripts. It is just a side effect of installing the EA Toolpack. The library is much richer then the standard EA API, and often allows you to write denser and more functional code. But it also has somewhat of a learning curve I guess.


PS. You don't have to use the EAAddinLibrary when writing EA-Matic scripts. You can also simply use the raw EA API.

Bugs and Issues / Re: User guide API documentation not navigable
« on: January 31, 2018, 04:32:16 pm »
Yes it is a bit awkward.
You repeatedly have to press the "Topics" button (called "dropdown" by Simon but doesn't look like a dropdown) to navigate deeper into the topics tree.


Using scripting to traverse a model is very slow in general.

Often SQL queries much better for this type of work. Major downside of using SQL is that it is hard to do anything recursive.
So if the (maximum) depth of the tree is unknown you might need to use some kind of scripting solution anyway.

But still then it will pay off to use SQL queries on each level recursively to get the elements, rather then iterating all the connectors of all the elements.


General Board / Re: Elements on diagram
« on: January 30, 2018, 02:53:17 am »
Look at the option "Support for Composite Objects" in Start | Preferences | Objects

But to be honest, most of the time that function works as it should. If you have an issue with that you might be doing something wrong. (such as putting Activities on an activity diagram)


Bugs and Issues / Re: Performance with MySQL database
« on: January 30, 2018, 02:48:46 am »
No sorry, don't know of any tools that might be of help.



You are not using VB, but VBScript. And regardless of EA, VBScript won't know about constants define by Excel or any other library.
All you can do is define the constants yourself in a similar way as Local Scripts.EAConstants-VBScript


General Board / Re: Hide packages/folders from users (Sparx V14
« on: January 26, 2018, 01:09:14 am »
The documentation is a bit self-contradicting if you ask me.
It says:
Only models hosted by a Pro Cloud Server are able to make use of this feature
But also
Since Row Level Security functionality is implemented by the database, it is impossible for users to bypass security implemented at the application level
Which makes me think it will work without Pro Cloud Server as well as it is basically transparent for the application.

Maybe it is a licencing issue rather then a technical limitation?


General Board / Re: EA Repository Table; How to get diagram types?
« on: January 26, 2018, 12:04:05 am »
For those interested, I use a free tool called Any SQL Maestro to query .eap file
It an be used with almost any type of database and it has a freeware version as well.


Bugs and Issues / Re: Performance with MySQL database
« on: January 25, 2018, 08:16:57 pm »

Thinks to consider:

- network: EA executes hundreds or even thousands of tiny a second. Often the network bandwith or latency can be a bottleneck
- Server config: I don't know anything about configuring database servers, but make sure it is optimized for this type of usage (e.g. lots of tiny inexpensive queries rather then small amounts of heavy expensive queries). Typically a MySQL database should be ideal for this type of usage seeing that this is very often used as the backend of a website.
- shape scripts: could slow down things a lot, especially if using add-in functions
- model views: some model views can be set to automatically refresh, which might be slowing down things
- add-ins: make sure to disable all add-ins and see if that makes a difference
- auditing: could have an impact as well
- diagram size: I've seen diagrams with thousands of elements on them. Those will be slow on any system. Don't do that unless you are in the wallpaper manufacturing business.


PS. Cloud server will probably not perform better in a LAN setup. It might help in a WAN config.

General Board / Re: Entity Missing
« on: January 25, 2018, 04:20:25 am »
Maybe the one entity is not selectable?

Anyway, I would be inclined to always start from a package rather then from a diagram. Any specific reason why you are using a selection on a diagram?


General Board / Re: Synchronizing ports ibd <-> bdd
« on: January 25, 2018, 02:32:49 am »
If you really want to you can probably work around the limitation.
I've seen that the composite mechanism if you set it using the API, even if the element type doesn't allow it in the GUI.
You might be able to do this in the GUI as well by changing the element type to Class, set the composite diagram, and then change it back to the original element type.

In order to send in a feature request you can use the link on the bottom of the page:


Automation Interface, Add-Ins and Tools / Re: Adding Tags via Javascript
« on: January 25, 2018, 02:18:35 am »
I was not aware the getTreeSelectedObject was this dangerous.

It's not really dangerous, but have to test what it returns. Depending on what you actually selected in the project browser it could any of EA.Package, EA.Diagram, EA.Attribute, EA.Operation, EA.Element or even null (if you haven't selected anything at all in the project browser)

You can't assume it will return an EA.Element


Automation Interface, Add-Ins and Tools / Re: Adding Tags via Javascript
« on: January 25, 2018, 01:11:00 am »
I'm still not seeing you initialize "theElement".
If you don't initialize the variable then it will have a null value (and null.TaggedValues.AddNew() won't work)


Pages: 1 ... 7 8 [9] 10 11 ... 531