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

Pages: [1]

We recently transitioned from Oracle to SQL Server 2012 to help with performance issues. Shortly after this, we realized that all of our Association Source and Targets had been trimmed down to 50 characters.

This was not a problem in Oracle but is in SQL Server 2012. Is there something in the Schema that is causing this trimming? If so how can we fix it in the schema or will that break other things?

Any help would be greatly appreciated, SQL Server is much faster but we are forced to work in slow Oracle if this issue can't be fixed.


Sean Conway

So say I have three in diagram scripts A, B, & C. When I run Script A, Script B runs instead. Or When I run Script C, Script A runs instead. Totally random and the only way to fix it is to restart EA.

Any ideas?

Automation Interface, Add-Ins and Tools / EA Runs the wrong Jscript
« on: April 01, 2016, 07:06:24 am »
I have a weird script issue that appears every now and then.

When I run the a JScript from a diagram it tries to run a different JScript in the same folder instead. This behavior continues until I restart EA. Then, the correct selected JScript will run normally for a while, but the problem will randomly start back up.



I sent support an email. Nothing yet, but I'll let you know what they say. I'll also try the Repository.Execute. Thanks for the help!

Thanks Gert, I really appreciate it man.

So I tried this with no luck:

diaElement = newDiagram.DiagramObjects.AddNew("l=200;r=320;t=20;b=140;","");
      diaElement.ElementID = currElement.ElementID;
      diaElement.ShowInheritedAttributes = true;

The flag doesn't change. Am I doing something wrong?


I don't see any documentation on how to use the DiagramObject method ShowInheritedAttributes. Does anyone know how to use them? I've tried setting it as Boolean or integer or even strings without luck. It is not documented in any of the API documentation.

Any ideas or thoughts would be greatly appreciated.


Sean Conway


I have a script that looks at a class and then creates a diagram with that class on it and all other classes connected to it via associations, generalizations, etc...

So far it works great, but I also want to automate the Feature and Compartment Visibility, so that I can automatically show notes, wrap Features, and show Attributes on all of the classes on the diagram.

How do you access the feature and compartment visibility from the API? Is it even possible. I would assume it would happen at the Diagram Object level. Am I looking in the wrong API Class??

Any help would be greatly appreciated we are building 1000's of these diagrams so doing it manually will be a chore.


Sean Conway

So I think I narrowed the problem code down to this line:

Collection allElements = repo.GetElementSet(null, 0);

I was calling this at the beginning of the tool to get a collection of classes with a specific stereotype. After removing this in favor of iterating through each package in the model looking for elements, EA stopped crashing.

Any ideas on why this call would not immediately cause a crash but instead cause a crash later in the program at a random spot?


Sean Conway


Another note: Could this be related to the latest Windows 7 Update? I swear this code had no issues until I got the latest Windows 7 push on Wednesday last week. Could that mess up the COM API for EA or is that out of the questions?

The code fails in completely random areas each time while trying to create diagrams or add objects to a diagram for example:

                                Collection conceptualDiagrams = newConceptualPackage.Diagrams;
                                Diagram newConceptualDiagram = conceptualDiagrams.AddNew(faceSDMObs.Name, "Conceptual");
                                Console.WriteLine("Created a Conceptual Diagram " + newConceptualDiagram.Name);
                                Collection newDiagramObjects = newConceptualDiagram.DiagramObjects;
                                DiagramObject fObsDiaObject = newDiagramObjects.AddNew("l=200;r=320;t=20;b=140", "");
                                fObsDiaObject.ElementID = faceSDMObs.ElementID;
                                Console.WriteLine("Created a Conceptual Diagram Object " + faceSDMObs.Name);


Sean Conway


I translated all of the code into C#, and now I keep getting a:

Exception thrown: 'System.Runtime.InteropServices.COMException' in JCA_Transform_Master.exe
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in JCA_Transform_Master.exe
Additional information: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Pretty much EA crashes at random spots during the iterative Transform resulting in the com error above. Have you ever seen this? I don't see any reason that EA should be crashing and like I said it is random the element is always different that it chokes on. Any ideas would be appreciated.

Do I need to put timeouts in my code to ensure EA has enough time to complete actions? I'm running on a fast box Windows 7 with 32 GB RAM.


Sean Conway

Thanks for the quick reply Geert. I like the idea of switching over to C#, but are you sure I won't run into this same problem?

What development environment would you recommend for C#? I have the free visual studio will that suffice for Sparx EA API Development?


Sean Conway

I create a java program that iterates through a selected EA model transforming classes from one modeling standard to another. The program copies the elements in the old standard and then creates the same elements in the new standard. To do this there are a lot of collections called, elements created, and iterations through the model. I continually max out the javaw.exe memory around 1.5 gb. Since I can't use any more memory than this, my program fails.

I know in the past the EA Java API had troubles with memory not freeing up, so I am manually calling


in many parts of my code to try and clean out the unused elements. This doesn't seem to help at all.

I am also trying to destroy unused objects. After each collection is done being used I am manually calling .destroy() to try and free up the memory. Again this does not help at all.

What am I doing wrong? In much older posts from 2007, I see a Repository.Compact() recommeneded, but that method does not seem to exist any more. Any ideas or guidance would be appreciated.


Sean Conway

Pages: [1]