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

Pages: [1]
1
It's always a good idea to state the used EA version.

q.

Yes, you're right. I forgot. My version is EA 14.1.1427 - should be fairly recent

2
Hi there,

In my diagram I have a bunch of lookup tables (Id, Name) that will translate to enums in code.
I'm trying to add the values as example in the element notes, but the word wrapping makes it look very strange when I don't add addition text

This is what it looks like without text:


Then when I add some dummy text, it does format everything normal:



Anyone know to to stop it from word wrapping like that?

Thanks

Edit: When I tried to add a different placeholder text, it does this:

... Can it not just format the text normal?  :-\

3
Hey, Geert,

Ok thanks. After a while I did get the EAAddinFramework project to compile, after removing most of the add-in related things from the projects.

I mentioned just using Interlop.EA, because your library seemed very big, with all kinds of dependencies, some related to UML diagrams, some TFS work ticket stuff, some related to Addin UI stuff. - No offense to your libraries though, from the looks of it you can a lot of things with it.

My initial plan was just some simple validations are refactoring/renaming that won't become an addin, but just a winform or console instead.
(for example, some validations:
- name all foreign keys $"FK_{child.column}_{parent.column}
- name all primary keys $"PK_{parent.column}
- this seems like a EA bug but: When I have a unsigned int with a relation that I change to a char, the char(n) becomes an unsigned char in my script - not valid sql)

Anyway - the whole wrapping framework you've made seems pretty useful. I've been busy trying to debug against these COM calls the whole day, and it's going terrible... If I could load the whole model in memory first or something, it'd make my life a lot easier.

I'm home now, tomorrow at work I'll continue trying.

Is the assumption correct:
I can just include the EAAddinFramework project, create a class that inherits from EAAddinBase, and then us that on a EA.Repository, and use it for parsing and renaming purposes?

Or - probably a better question, any tutorial or guide on how to use your libraries (as processing libs, not an actual add-in)

Thanks a lot for the help so far.


4
Thanks for your quick response.

I'm trying to compile your github repo, but I'm getting about 2000 errors.
I guess mainly because of this.

Code: [Select]
4019: The imported project "C:\Program Files\dotnet\sdk\2.1.101\Microsoft\WiX\v3.x\Wix.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I'm still trying to get it to compile by installing a bunch of things (like the WiX framework) and updating everything, but that might take a while

Anyway, I tried to follow your code, and I still have no clue what to do...

Would this be possible with a simple Interlop.EA call? Because none of those things even exist there


The operations in there are called methods, and there's no mention of associations, or anything that seems similar

Edit: btw, I just started off with the sample from the "C:\Program Files (x86)\Sparx Systems\EA\Code Samples" folder

5
Hi there,

I'm trying to programmatically rename a bunch of things. Renaming Tables and columns works perfectly, however, when I try to rename a foreign key, it will lose the reference to the table.
Here's the script it generates when I havent changed anything programmatically:

Code: [Select]
/* ---------------------------------------------------- */
/*  Generated by Enterprise Architect Version 13.5 */
/*  Created On : 30-May-2018 3:09:57 PM */
/*  DBMS       : MySql */
/* ---------------------------------------------------- */

SET FOREIGN_KEY_CHECKS=0
;

/* Drop Tables */

DROP TABLE IF EXISTS `ChildTable` CASCADE
;

DROP TABLE IF EXISTS `ParentTable` CASCADE
;

/* Create Tables */

CREATE TABLE `ChildTable`
(
`Id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`ParentFK_Id` INT NOT NULL,
CONSTRAINT `PK_ChildTable_FFFFFFFFFFFFFFFF` PRIMARY KEY (`Id` ASC)
)

;

CREATE TABLE `ParentTable`
(
`Id` INT NOT NULL,
CONSTRAINT `PK_ParentTable` PRIMARY KEY (`Id` ASC)
)

;

/* Create Primary Keys, Indexes, Uniques, Checks */

ALTER TABLE `ChildTable`
 ADD INDEX `IXFK_WorseNamedIndex` (`ParentFK_Id` ASC)
;

/* Create Foreign Key Constraints */

ALTER TABLE `ChildTable`
 ADD CONSTRAINT `FK_PoorlyNamedKey`
FOREIGN KEY (`ParentFK_Id`) REFERENCES `ParentTable` (`Id`) ON DELETE Restrict ON UPDATE Restrict
;

SET FOREIGN_KEY_CHECKS=1
;

Then when I do update the foreign key, this is the result:

Code: [Select]
/* ---------------------------------------------------- */
/*  Generated by Enterprise Architect Version 13.5 */
/*  Created On : 30-May-2018 3:35:19 PM */
/*  DBMS       : MySql */
/* ---------------------------------------------------- */

SET FOREIGN_KEY_CHECKS=0
;

/* Drop Tables */

DROP TABLE IF EXISTS `ChildTable` CASCADE
;

DROP TABLE IF EXISTS `ParentTable` CASCADE
;

/* Create Tables */

CREATE TABLE `ChildTable`
(
`Id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`ParentFK_Id` INT NOT NULL,
CONSTRAINT `PK_ChildTable_FFFFFFFFFFFFFFFF` PRIMARY KEY (`Id` ASC)
)

;

CREATE TABLE `ParentTable`
(
`Id` INT NOT NULL,
CONSTRAINT `PK_ParentTable` PRIMARY KEY (`Id` ASC)
)

;

/* Create Primary Keys, Indexes, Uniques, Checks */

ALTER TABLE `ChildTable`
 ADD INDEX `IXFK_WorseNamedIndex` (`ParentFK_Id` ASC)
;

/* Create Foreign Key Constraints */

ALTER TABLE `ChildTable`
 ADD CONSTRAINT `FK_Programmatically_Renamed`
FOREIGN KEY (`ParentFK_Id`) REFERENCES  () ON DELETE Restrict ON UPDATE Restrict
;

SET FOREIGN_KEY_CHECKS=1
;


specifically this line:
Code: [Select]
FOREIGN KEY (`ParentFK_Id`) REFERENCES  () ON DELETE Restrict ON UPDATE Restrict`
My C# code to update the foreign keys is roughly this:

Code: [Select]
            Repository repo = RepositoryContainer.Repository;

            foreach (Package package in RepositoryContainer.Repository.Models)
            {
                foreach (Package innerPackage in package.Packages)
                {
                    foreach (Element element in innerPackage.Elements)
                    {
                        foreach (Method method in element.Methods)
                        {
                            if (method.Stereotype == "FK")
                            {
                                if (method.Name == "FK_PoorlyNamedKey")
                                {
                                    method.Name = "FK_Programmatically_Renamed";
                                    method.Update();
                                }
                            }
                        }
                    }
                }
            }

In the model it looks updated, however when I export my script, the reference is gone.

I don't think I can attach files here, so I've updated a valid sample and a broken sample to my dropbox, which you can see here: and it should export the sql from above.
https://www.dropbox.com/s/6n73fvzc33840z5/Samples.zip?dl=1

Any help on how to do this would be appreciated.

6
Bugs and Issues / Unable to use negative StartNum for AutoIncrement
« on: November 20, 2010, 01:04:52 am »
This StartNum:

http://www.sparxsystems.com/uml_tool_guide/data_modeling/createcolumns.htm

Well, in my database MSSQL Database I use INTs as Identifier. The range of an INT is -2^31 to 2^31. I know its not very common to use a negative Identifier, because that seems to look weird, but that's kind of stupid in my opinion.

Basically if you have to start at 0, you are throwing away half your range...

And no, MSSQL does not have unsigned INTs.

Enterprise architect does not allow you to input negative values into the StartNum field, which I think is an issue. Actually, I think it should be INT(MIN), or {VALUETYPE}(MIN) by default, instead of 0, to not encourage people to throw away half their range...

7
Hello,

I've found a bunch of tutorials on how you can create your own MDG template from scratch, however, those seem a little complex. I'd rather just tweak an existing one.

I noticed that in the folder EA\MDGTechnologies there already are a bunch of existing technologies, in XML format. So, I was wondering if instead it was possible to import any of those, and use it as an example. Maybe change a bunch of things, and save it as a new version... I've been trying to import MindMapping.xml, because of the easiness of that diagram, but I haven't succeeded so far.

Is this supported by EA? If its not, what should I use to do this? I do have visual studio, for example..

Thanks

Pages: [1]