Book a Demo

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

Pages: [1] 2
1
I'd run Process Monitor (https://docs.microsoft.com/en-us/sysinternals/downloads/procmon) and try and capture exactly what is happening when it freezes.
I guess debugging it would be the first step right?

Geert

I have tried to debug it and attach it to EA.exe to see where in the code it freezes, but I get no information from this method because EA freezes right away when I run the addin (from EA).

Why would there be a reason for the Addin to work on a local project class diagram, but not a 100% similar class diagram in a database? My lack of experience working with databases and EA is absolutely an obsticle here, so my questions may be stupid.

/Snow

2
Automation Interface, Add-Ins and Tools / Running Add-In on a database
« on: April 04, 2019, 08:29:10 pm »
Hi,

I am working on an Addin that creates a JSON-schema based on a class diagram in EA. When I run my Addin (by right-click inside the class diagram -> specialize -> Export JSON Schema) it works fine when I run it on a locally based project.

When I connect to a database by VPN (ODBC) and access a class diagram inside the database-repo and try to run the Addin, EA freezes completely.

Does anybody have any experience with this?

3
You have a null pointer exception in your code, so you should debug your add-in.

To do so, start EA, and then in Visual Studio choose for Debug | Attach to process and then choose EA.exe

Then do whatever you were trying when you got the error.

The processor architecture warning has nothing to with the null pointer exception and can be ignored AFAIK.

Geert


Geert. Thank you!

4
Hi,

Decently new to EA, I am currently working the Geert's Addin Framework, but I am still a bit unsure about how things work.
First of all, I am trying to create an Addin that can generate JSON-schemas based on class diagrams. I have created a simple Addin-class and it is able to create a JSON-schema skeleton. Though when I try to build another project in which I attempt to build a bit more properties on my JSON schema I get the error:

"EA_MenuClick: Object reference not set to an instance of an object."

I know the concept of what this means, but my question is if I can be doing something wrong when build the second project with the same name and trying to run the new Addin in EA? I also get a warning in Visual Studio that reads the following:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "UMLToolingFramework, Version=1.0.7010.23027, Culture=neutral, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.   

Do I need to go into my Registry Editor and in some way change what addin.dll EA takes in? I am unsure what I am doing wrong and my understanding of how EA accesses its registry and the addin within is still a bit unclear to me...

5
Looks like EAAddins should be one level above. It's on the EA400 level.

q.

P.S. Hey. This morning I had 10k posts. This one is 9997. So someone delete 3 of my posts. Who could have done that? And which posts have that been? Well, I don't expect any feedback...

Boom, thank you! Feel kinda stupid, but thanks!

6
Hi,

I have now used the legendary Bellekens' tutorial on how to create an Add-In to EA in 10 minutes:
https://bellekens.com/2011/01/29/tutorial-create-your-first-c-enterprise-architect-addin-in-10-minutes/

It is a great tutorial and I am sure there is just something I am misunderstanding, but I have created my project and when running "regedit" and opening the folder structure of "Sparx Systems" I see the following to folders; "EA" and "SSCE". There is no "EAAddins"-folder to put my addin namespace and addin class. I have then tried to create a folder under "Sparx Systems" named "EAAddins" and under that folder I've added a new one (right-click, and "New->Key") called "MyAddin". In the "Data" section I have put "MyAddin.MyAddinClass".

When I then try to open EA and go into "Specialize->Manage Addins" I am not able to see the Addin I just created an put into the registry.

What am I missing here?

If anything in this post is unclear, please let me know!

7
Hi,

I am working on extracting all information from a class diagram to create a basis for a JSON Schema for the specific diagram i EA. I am using JScript "inside" EA and working up against a database. I am getting an error using this line of code:

"var fh = fopen("c:\\MyFile.txt", 3); // Open the file for writing

Therefore my questions are:

  • Is what I am asking for possible to do scripting from inside EA?
  • If not, what would be the best way to create a console application that connects to a specific package inside an EA database?

All help and comments are appreciated!

8
You don't get elements but diagramObjects. Retrieve the elementId from the latter and fetch the element with Repository.GetElementByID

q.

Ah, thanks a lot! It worked!

9
Hi,

I am trying to extract enough information from a class diagram in EA to create a JSON Schema for that diagram. I am able to obtain the number of classes in the diagram, but when I iterate through those classes and try to fetch "currentClass.Name" I get "undefined". Can someone help me understand what I am misunderstanding here:

"var thePackage as EA.Package.;
   thePackage = Repository.GetTreeSelectedPackage();
   
   if ( thePackage != null && thePackage.ParentID != 0 ){
      
      var diagrams as EA.Collection;
      diagrams = thePackage.Diagrams;
      
      //Navigate the diagram(s) in the current package
      for (var i = 0; i < diagrams.Count; i++)
      {
         var currentDiagram as EA.Diagram;
         currentDiagram = diagrams.GetAt(i);
         
         Session.Output("Diagram Name: " + currentDiagram.Name);
         Session.Output("Diagram Element Count: " + currentDiagram.DiagramObjects.Count);
         
         var classes as EA.Collection;
         classes = currentDiagram.DiagramObjects;
         
         for (var j = 0; j < classes.Count; j++)
         {
            var currentClass as EA.Element;
            currentClass = classes.GetAt(j);
            
            Session.Output("Class: " + currentClass.Name);
         }
      }
      
   }
"

10
In the "Reset Source Language" you can replace whatever language you were using (e.g. Java) by another language (e.g. C#, <none>, ..)

So if you have added JSON as a code engineering language you should be able to replace Java by JSON for all elements in a package (and sub-packages if you check the checkbox)

Geert

Ah, there you go. Apparently it didn't work for the Model, but it actually applies for all users. Thanks Geert! :-)

11
Go to Code | Configure | Options | Reset Source Language

Geert

Maybe my formulation of the question was a bit vague.

I do not wish to reset the Source Language, that gives me Java. I would like to set a new one for the entire database so that all other users of that database also gets the effect of my change. Not sure if I'm making completely sense?

12
General Board / Setting/changing default language for an entire database
« on: February 21, 2019, 10:58:27 pm »
Hi all,

I am working on an EA database and through "Configure -> Reference Data -> Settings -> Code Engineering Types" I have added a JSON language to be able to add JSON types from the dropdown menu. I wish to change the default language for all packages and diagrams within the top level package.

I am able to change the individual package language to JSON by going into "Element Properties" and Advanced->Language. But for the JSON language this is not applied to the entire database for all users accessing the database. This means that everyone using the database needs to create a JSON language and manually add it to all packages.

Does anyone have a smooth solution or any experience with this?

13
Automation Interface, Add-Ins and Tools / Schema Composer
« on: February 12, 2019, 07:12:06 pm »
Hi all,

I am using the Schema Composer to generate JSON Schema's and XML Schema's (XSD). I have read the documentation EA provides for the Schema Composer, but I am still seeing what I would refer to as "random behaviour" when I generate JSON's. Does anybody know what the Schema Composer is built upon, if it is possible to configure it or make complete sense of it?

To me (and apparently others as well) it is a black box. Are there anyone with some knowledge of what is inside that box?


/MrSnow

14
I'm producing JSON Schemas for my class diagrams in EA, but I need to differ between the type "date-time" and "date" which does not contain any information about the time. When produce JSON's with the Schema Composer's Generic Schema set those attributes with type "date" gets converted to type "string".

Does anybody have a solution for this?

15
Setting the lowerbound of the multiplicity to 1 should do.

Geert

I've set the lowerbound of the multiplicity to 1, but none of the schema types in the schema composer registers this info and puts it in the JSON. On some element attributes I actually get the:

"maxOccurs" : 1,
"minOccurs" : 1

In the JSON Schema generated with Generic. But most of my attributes doesn't get that information. Do you know why?

Pages: [1] 2