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.


Topics - Geert Bellekens

Pages: [1] 2 3 ... 14
1
Bugs and Issues / How to delete a style in version 13+?
« on: December 07, 2017, 07:48:28 pm »
Since version 13 I don't seem to be able to delete styles anymore.
In version 12 there was a delete button on the "Edit Stylesheet" dialog, but in version 13 that button is no longer there.
(I now open the stylesheet in v12 in order to delete a style)

Anyone know if this has been moved to another location, or is that just an oversight?

Geert

2
Very often when writing scripts I have to do something with a selection of elements in the selected package or or nested packages.
Because iterating all elements of all packages recursively is very slow, I usually try to get the elements I need using an SQL query.

Now when using SQL searches you can use the macro #Branch# to get all package ID's of the currently selected package and all nested packages. Because that macro can't be used in scripting I'm making the package ID string myself. This works ok, but it is not super fast. In the model I was using it on this function alone took about 4 minutes (of the 11 minutes of the whole script)
Does anyone have an idea for a more efficient implementation?
I guess I could bypass the API completely and rely only on database queries to get the ID's of all the packages.

Code: [Select]
'get the package id string of the given package tree
function getPackageTreeIDString(package)
'initialize at "0"
getPackageTreeIDString = "0"
dim packageTree
dim currentPackage as EA.Package
if not package is nothing then
'get the whole tree of the selected package
set packageTree = getPackageTree(package)
' get the id string of the tree
getPackageTreeIDString = makePackageIDString(packageTree)
end if
end function

'returns an ArrayList of the given package and all its subpackages recursively
function getPackageTree(package)
dim packageList
set packageList = CreateObject("System.Collections.ArrayList")
addPackagesToList package, packageList
set getPackageTree = packageList
end function

'add the given package and all subPackges to the list (recursively
function addPackagesToList(package, packageList)
dim subPackage as EA.Package
'add the package itself
packageList.Add package
'add subpackages
for each subPackage in package.Packages
addPackagesToList subPackage, packageList
next
end function

'make an id string out of the package ID of the given packages
function makePackageIDString(packages)
dim package as EA.Package
dim idString
idString = ""
dim addComma
addComma = false
for each package in packages
if addComma then
idString = idString & ","
else
addComma = true
end if
idString = idString & package.PackageID
next
'if there are no packages then we return "0"
if idString = "" then
idString = "0"
end if
'return idString
makePackageIDString = idString
end function

Geert

3
Bugs and Issues / attribute order messed up
« on: November 16, 2017, 07:12:04 pm »
When deleting attributes the positions of the attributes are not recalculated. This results in inconsistent behavior when adding attributes and changing their order.

This is a serious problem for anyone doing any type of code generation (xml, DDL)

Current workaround is to move the new attribute all the way to the first position and then back. This triggers a recalculation of the position for all attributes.


Steps to Reproduce:
- turn off alphabetic ordering for attributes
- Create class with following attributes
Pos name
----------- ----
0 z
1 q
2 n
3 h
4 a

- Delete "n" and "h" I'm and notice the missing pos 2 and 3

Pos name
----------- ----
0 z
1 q
4 a

- Add "m" to the end and save
- Notice that m has gotten pos 3 and is therefore placed between q and m instead of at the end.

Pos name
----------- ----
0 z
1 q
4 a
3 m

4
Automation Interface, Add-Ins and Tools / Repository.SaveImageToPath
« on: November 09, 2017, 09:54:54 pm »
I just found this operation on the EA.Repository class, but it doesn't seem to be documented.
Does anyone have any idea what it does?

Geert

5
Bugs and Issues / Bug when copying package
« on: October 19, 2017, 12:31:55 am »
When copying a package you can get nasty side effect if other classes are depending on classes in the copied package.
E.g. classes in other packages that have a generalization to classes being copied now have two generalizations. One to the original, and one to the copied class.

Steps to Reproduce:
- create packageA with classA
- create packageB with classB
- create generalization from classB to classA
- copy packageA (full structure for duplication)
- paste packageA resulting in a copy of packageA
- notice that classB now has two generalizations. One to the original ClassA, and one to the copied ClassA.

Reported

Geert

6
I just got a change request for one of my add-ins to export a .png of every diagram in scope (selected package tree), along with the xmi export it is already doing.

Now I'm a bit concerned about the performance. I'm afraid export diagram images for each and every diagram is going to be very slow, and if I remember correct EA will also open each and every single diagram before exporting its image to a file.
So that would not be a good user experience.

Now with EA 13 there is an option to cache the diagram images upon saving a diagram.
I was thinking that that might be a much quicker way to get the export I need since the images are already there and I just need to pour them into the right file format.

Has anyone done something similar before?
Where does EA store the cache? (in t_document?)

Any helpful hint is much appreciated.

thanks

Geert

7
Bugs and Issues / Exception & crash when using Repository.GeElemementByID()
« on: September 28, 2017, 04:03:33 pm »
In very specific circumstances using Repository.GetElementByID() by an add-in results in a stackoverflow or other non recoverable exception, resulting in the immediate shutdown of EA.

The weird thing is that it worked just fine seconds before, but apparently, right after clicking OK on the connector dialog, the system is in some kind of corrupted state and is not able anymore to get the element by it's ID


Steps to Reproduce:
- Create new class by dragging class icon from toolbox onto diagram that already contains another class
- Press OK on the dialog box for the class (resulting in something like Class1 with no other details)
- Select the association connector from the toolbox and drag the new association from the new class to an existing class.
- Doubleclick on the association and fill in source role, target role, source multiplicity and target multiplicity
- Press OK
- Now immediately use the function Repository.GetElementByID() in an add-in with the ID of the new class. Notice that EA crashes.

You can also see the result when using a script. right before opening the connector dialog it works just fine. Right after closing the dialog the script reports an error (but for some reason now EA doesn't crash)

Bug reported.

Geert

8
Bugs and Issues / hard crash on editing new association in v13.5
« on: May 25, 2017, 12:31:14 am »
When I do the following
- Create a new class
- create a new association from the quicklinked
- doubleclick on the association to open its properties
- fill in the name of the association
- fill in the source name, target name, source multiplicity, target multiplicity
- press OK

EA crashes hard (as in completely gone with useless windows windows box asking me if I want to debug or close it)

After disabling all add-ins the problems seems to be solved.
I'll be activating each add-in one by one to try and figure out what is causing this issue.
Anyway, with the same set of add-ins this didn't used to happen in any previous version.

To be continued...

9
Automation Interface, Add-Ins and Tools / Zipping MDZip files
« on: May 10, 2017, 03:30:27 pm »
Hi,


A client of mine is going through the process of migrating their Magicdraw models to Enterprise Architect.
Because of some issues in transferring the models we wanted to unzip the mdzip files, change the xmi contents, and then rezip them in order to import them into EA.

But for some reason that doesn't seems to work. Even without changing anything to the contents, just unzipping and rezipping the file and then trying to import it into EA we get "analyzing mdzip file" for a few seconds and then it stops.
I'm suspecting that we are using the wrong zip settings to rezip the file.

Does anyone know which settings we should use to produce a valid mdzip file that can be imported into Enterprise Architect?

Thanks

Geert

10
The UMM/UPCC3 method uses inheritance to assemble enumerations.
One enumeration could inherit from different other enumerations with the intention of combining the values of all the parent enumerations.
The problem is that currently the Schema Composer doesn't allow the selection of those "inherited" enumeration literals. As a workaround we have to copy all the values down to the assembled enumerations, but that is error prone and not according to the UN/CEFACT recommendations.
Please allow inherited enumeration literals to be selected in the schema composer exactly like we can do with inherited attributes.

Thanks

Geert

(Feature request sent)

11
I'm working on a document that should be printed in either dutch or English. We store the English name in the name, and the Dutch name in the Alias.
The problem is that the Dutch name is not always filled in. In those cases I should print the English name.

Does anyone have a bright idea on how to do that?
With the Start/End bookmarks I can hide something when not filled in, but I cannot do the opposite, show something else if a field is not filled in.

The only solution I see at the moment is to go completely SQL or Script, but I'd rather avoid that.
A feature like 'Use Alias if Available' for reports would be ideal.

Thanks

Geert

12
Hi,

Does anyone has a shapescript example of how to make an attributes compartment, pretty much the same as in regular UML classes?

I checked my library, and the examples in the help, but I couldn't locate such an example.

Thanks

Geert

13
Bugs and Issues / {Diagram.Figure} not working anymore in v13 RTF templates
« on: February 16, 2017, 07:55:49 pm »
I just noticed that my existing templates have a problem when generating a report in version 13.0.1309
Instead of sequence number of the diagram I get the text "Diagram Sequence" when I use the field {Diagram.Figure}
These templates work perfectly fine in v12.1.1230

Reported as a bug.

Geert

14
General Board / UN/CEFACT Message Composer tutorial
« on: February 11, 2017, 01:24:12 am »
Hi,

Recently EA claims to support the UN/CEFACT standard to create message definitions.
I searched the help, and found some bits and pieces, but I can't seem to find a good tutorial or example that shows me the steps I'm supposed to take to go from model to message.

I'm sure there is a specific way this is supposed to be used, I just can't find an explanation.

Does anyone know a tutorial or kind of explanation on how this feature is intended to be used?

Thanks

Geert

15
I'm extending one of the yellow stereotypes of Archimate 2 (Business Object) and that all works out fine, except for the fact that my new stereotype has the standard fill color (beige) while original Archimate element is yellow.
I'm wondering how the Archimate elements get their yellow color.
It's not defined in their shapescript (I checked) so it must be somewhere else, but I have to clue where.

I can ofcourse add the yellow fillcolor in the shapescript, but I would rather do it like Archimate does.

Anyone here who knows the secret sauce to make this work?

Geert

PS. I tried drawParentShape() but that didn't make any difference (it must have done that already because it otherwise looks exactly like an Archimate Business Object, except for the color that is)

Pages: [1] 2 3 ... 14