Author Topic: Merge Classes From Multiple Packages  (Read 2934 times)

bjw122

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Merge Classes From Multiple Packages
« on: December 08, 2010, 05:37:43 am »
I have several packages in my EA project, wherein each package contains one physical data model diagram and the classes (tables) that are used in that diagram.

I would like to create a new project that has a single data model diagram in it that contains all of the classes from each other project.  Furthermore, I would like the new data model diagram to include all of the classes.

So, basically, I'm asking if there's a way to merge several packages into one new package, and have the data model diagrams be merged too.  I want to avoid having to re-create the associations (FK relationships) between the classes during the merge.

I tried this process:
1.] Created a new package, "Merged Physical Data Model"
2.] Exported one of the packages, "Core Schema", using the "Export Package to XMI file" option.  The Export completes successfully.
3.] Click on the "Merged Physical Data Model" package and selected "Import Package from XMI file", setting "Treat Import Datatypes" to  "DDL:Oracle", but I got this error:

Error:  Root import package already exists in another location.
Conflict is with existing package: 'Core Schema'.


So, even though I'm importing into a different project (Merged Physical Data Model) I'm getting an error about a conflict with a package in another package (Core Schema).

My hope was that I could use Export/Import to export all of the objects from their separate projects and import them into a single new project.

Any ideas on how to accomplish what I'm trying to do?  Again, I'm really trying to avoid having to re-draw the data model diagrams, I simply want to merge the diagrams into one large diagram.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Merge Classes From Multiple Packages
« Reply #1 on: December 08, 2010, 09:53:50 pm »
Then why don't you just create a new diagram and drag all the classes on it, or copy paste the contents of the different diagrams into the behemoth diagram?
I have doubts about the usefulness of these kind of diagrams (what are you going to do with it, plaster the walls?), but technically that is perfectly possible.

Geert

bjw122

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Merge Classes From Multiple Packages
« Reply #2 on: December 09, 2010, 01:51:50 am »
Hi Geert -

Thanks for your help.

I want to have all of the tables represented on one diagram because I've reached a point in my data modeling where I need to create relationships between tables that currently appear in separate schemas, one schema per EA project.  FK relationships between schemas are supported in Oracle (cross schema FK constraints).

If I use the OWNER attribute in EA I can assign each table to a schema, but all of the schemas can be represented in one physical data model.  That's nice because then I can create cross-schema FK constraints right in EA, whereas if the objects I want to connect via a FK constraint exist in separate projects (schemas) EA won't allow me to form an association between the tables.

If I just drag and drop all of the classes into a new project the associations are maintained in the new diagram for the project, however I would need to re-organize the classes in the diagram because their arrangement gets all messed up.  This would take considerable time because there are a lot of associations.  Do you know of a way to copy objects from a diagram to another diagram and have the organization of the objects maintained?

bjw122

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Merge Classes From Multiple Packages
« Reply #3 on: December 09, 2010, 02:22:06 am »
Quote
If I just drag and drop all of the classes into a new project the associations are maintained in the new diagram for the project, however I would need to re-organize the classes in the diagram because their arrangement gets all messed up.  This would take considerable time because there are a lot of associations.  Do you know of a way to copy objects from a diagram to another diagram and have the organization of the objects maintained?

I've discovered that if I create a new project, then click on one of the diagrams that I want to copy into the new project I can do "Copy Diagram" --> "Paste Diagram" and choose the "Deep (duplicate ALL elements)" option and that maintains the organization of the classes in the diagram.  Now, I want to copy the second schema into the same (new) diagram, but I can't figure out how to copy a diagram and paste into an EXISTING diagram (which would do a diagram merge).  Any ideas?