Book a Demo

Author Topic: Multiple Instances of an Element in a Diagram  (Read 7529 times)

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Multiple Instances of an Element in a Diagram
« on: July 27, 2011, 10:23:26 pm »
Hi! Is there a way to put multiple instances of an element into a diagram (not by pasting as an instance, but actual links)? I know the program doesn't want me to do this, but is there a workaround?

Cheers,
Sam
Using EA 9.0.908 System Engineering Edition.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multiple Instances of an Element in a Diagram
« Reply #1 on: July 27, 2011, 11:21:54 pm »
I think I've done this once by mistake using the API.
So yes, I think its possible, and no I don't think its a good idea :D

Geert

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #2 on: July 27, 2011, 11:48:32 pm »
 :P
Is there a good reason why it's a bad idea (given the existing structure of EA) and is there a good reason why it ~should~ be a bad idea? :D
Using EA 9.0.908 System Engineering Edition.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multiple Instances of an Element in a Diagram
« Reply #3 on: July 27, 2011, 11:58:52 pm »
Sam,

Search the forum for things like "multiple instance diagram"
There's been a whole discussion about the pro's and con's of having multiple instances of the same element on a diagram.
The reason its a bad idea is because EA is build on the assumption that there will only be one instance of an element on a diagram.
Who knows what will go wrong if you bypass that.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multiple Instances of an Element in a Diagram
« Reply #4 on: July 28, 2011, 12:00:01 am »
By the way, I've never had the need to put multiple representations of the same element on a single diagram.
Why do you need that?

Geert

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #5 on: July 28, 2011, 12:57:10 am »
I had a search before I first posted but couldn't find anything.

The reason it's relevant is that we're using EA to architect both hardware and software in a system, so there might be several occurrences of a piece of hardware. I might be asking for the wrong thing with multiple instances (as I may want them to have distinct connectors), but if possible I'd like for them to 'inherit' properties (and changes) from some master element. Thus if the master element had its stereotype changed, all the slaves would too.
Using EA 9.0.908 System Engineering Edition.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #6 on: July 28, 2011, 08:44:45 am »
Quote
... so there might be several occurrences of a piece of hardware. I might be asking for the wrong thing with multiple instances (as I may want them to have distinct connectors), but if possible I'd like for them to 'inherit' properties (and changes) from some master element. Thus if the master element had its stereotype changed, all the slaves would too.

You should be able to do it by creating instances of your hardware. (Ctrl+Drag from the project browser to a diagram is one way to do that.)

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #7 on: July 28, 2011, 08:07:02 pm »
But instances made in this way don't maintain the stereotype and other properties of the original (apart from the name, if the instance has no name itself). Other things aren't synchronised, and embedded elements aren't also copied. Would there be some way to do that?
Using EA 9.0.908 System Engineering Edition.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #8 on: July 29, 2011, 08:51:01 am »
Open the embedded elements dialog to copy the embedded elements. Tagged values are visible (in the tag window). For me the stereotypes are copied.

It also allows you to set run time properties. (eg. cpu, hard drive etc.)
« Last Edit: July 29, 2011, 08:53:26 am by simonm »

Shemuel

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
  • Oh, hi there.
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #9 on: July 29, 2011, 09:00:13 pm »
Ah, tagged values are synchronised between the original object and the instance; that's good to know.

The thing about the stereotype and, say, default appearance - it's correct when the instance is created, but if the original is changed afterwards then the instance doesn't change too.

Also I can get it to copy the embedded parts now (thanks) but those embedded parts are distinct elements, not related to the embedded parts in the original object. It also doesn't copy connections between copied embedded parts.

It might not be feasible, but I guess what I'm looking for is a way to clone an element that makes a one-way parent-child link. I.e. any change made to the parent (or its embedded elements) is also made to the child, but changes made to the child are not made to the parent.
Using EA 9.0.908 System Engineering Edition.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #10 on: August 05, 2011, 12:34:38 pm »
Here is a case where I would like the same element twice

Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Multiple Instances of an Element in a Diagram
« Reply #11 on: August 05, 2011, 04:20:10 pm »
Yep,

Now that you mention it, that is indeed an example where multiple representations of the same element could be useful.
I think I've run into something very similar myself too.

Geert

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Multiple Instances of an Element in a Diagram
« Reply #12 on: October 28, 2011, 01:19:40 pm »
After  coming across more cases where diagrams would convey their meaning better if multiple instances of the same element were allowed I propose the following,
in advance of a feature request.

Allow multiple instances of the same element on a diagram to be enabled in the diagram properties.

The first instance of the element should behave as it would if there were no other instances on the diagram (connectors added automagically when element added to diagram, and when connectors added to other diagrams).

Second and subsequent instances to have no automatic drawing of connectors (no reason why Add related elements should not work though, ie a connector may also be shown twice on the diagram).

Second and subsequent instances could be named Instance:1, Instance:2, etc (this is how another package manages it)

If the primary instance is ermoved from the diagram another instance becomes the primary one (but does not have existing displayed connections moved to it, only, say, new ones)

See also
Multiple instance of same element in diagram
8.0 diagram enhancements
Only 1 Instance Of an Element Allowed On A Dia
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.