Author Topic: Create instances with connectors  (Read 817 times)

Csaba Koszegi

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Create instances with connectors
« on: February 17, 2015, 07:14:55 pm »
Hi,
I would like to create instances from a set of elements situated in different packages, so that the resulting instances have the same relationships as their classifiers.

1. "Copy connectors" is effectiv only for elements dropped together from the project browser on a diagram, but multiple selection in project browser is possible only for elements in the same package.

2. Gathering the needed elements on a diagram, making here a multiple selection and dropping them on another diagram like instances does not work because only elements of the same type and stereotype are accepted in one operation.

Does anybody know other solution?

Thanks:
Csaba K[ch337]szegi


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 9466
  • Karma: +264/-27
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Create instances with connectors
« Reply #1 on: February 17, 2015, 08:41:56 pm »
You could write a small script or addin to do that for you.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 10578
  • Karma: +232/-191
  • I'm no guru at all
    • View Profile
Re: Create instances with connectors
« Reply #2 on: February 17, 2015, 08:45:17 pm »
You need to select the classifiers in the browser. Then (ctrl-) drag them over a diagram where you want to see the instances. The ctrl is needed if you made changes to the drop-to-diagram dialog before and does not hurt in the other case. Now select "for all", "copy connectors" and "as instance". That will create the instances in the folder where the diagram is located.

You could do the same using the API if you need some sort of automated selection of classifiers for a larger count.

q,

Csaba Koszegi

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Create instances with connectors
« Reply #3 on: February 17, 2015, 11:30:20 pm »
@qwerty
 - "... select the classifiers in the browser" - how to do it, if they are not in the same package?

qwerty

  • EA Guru
  • *****
  • Posts: 10578
  • Karma: +232/-191
  • I'm no guru at all
    • View Profile
Re: Create instances with connectors
« Reply #4 on: February 18, 2015, 12:04:06 am »
By ctrl-clicking them. I confess, this can be tedious. You might create a Model View that finds the relevant classes or you can use the search results (in which case you need to make the search results floating or docked somewhere else).

q.

P.S. I just noticed that in V12 dragging from the search view does not show the "As Instance" dialog for the 2nd dropped element.

P.P.S: V11 the same, so I guess this is "normal" EAUI
« Last Edit: February 18, 2015, 12:30:31 am by qwerty »

Csaba Koszegi

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Create instances with connectors
« Reply #5 on: February 18, 2015, 12:49:03 am »
Try ctrl-click, please, for some elements in different packages! Only the last ctrl-clicked element remains selected at me. I use V11.

qwerty

  • EA Guru
  • *****
  • Posts: 10578
  • Karma: +232/-191
  • I'm no guru at all
    • View Profile
Re: Create instances with connectors
« Reply #6 on: February 18, 2015, 02:20:31 am »
OMG - EAUI :-[

So your last resorts are a) doing it one by one or b) write a script.

q.