Book a Demo

Author Topic: Insert Related N-ary Associations - version 10  (Read 8636 times)

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Insert Related N-ary Associations - version 10
« on: June 05, 2013, 11:50:44 pm »
I have a model with Classes attached to n-ary associations and I would like display the associations on a diagram.

In version 7.5 I could add them by right clicking on a class in a diagram and selecting something like 'add related ...' option.  In version 10 the n-ary associations are not shown in the "Insert Related Elements ..." dialog box. (But they are shown in the 'Links' tab of the Class Properties.)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #1 on: June 06, 2013, 04:40:08 am »
You can only attach one class to an association (the single association class). If you need many you must insert an association class element (lozenge).

Regarding the context menu: as in each major release you need to find many commands "somewhere else".

q.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #2 on: June 06, 2013, 09:23:01 am »
You might like to send in a bug report. In the meantime, try using the relationship window (Ctrl+Shift+2) to find related n-ary association elements.
The Sparx Team
[email protected]

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #3 on: June 06, 2013, 06:04:50 pm »
Thank you both for your replies.

qwerty: the object I am trying display on a diagram is already in the model and attached to multiple classes.  In the Toolbox it is called Association and looks like a diamond with three connectors attached.  In the user guide it is called n-Ary Association:

http://www.sparxsystems.com/enterprise_architect_user_guide/10/domain_based_models/n_aryassociation.html

I was hoping someone else would know the "somewhere else".

KP: I will send in a bug report, thanks.  I can also see the relationships in the 'Links' tab of the 'Class Properties' dialog box the association is attached to, I just don't know how to get the association into a diagram :/

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #4 on: June 06, 2013, 06:34:17 pm »
The lozenge is an element. Drop it from the toolbox onto the diagram. Then connect it to other classes via usual associations.

q.

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #5 on: June 06, 2013, 06:52:18 pm »
qwerty: I have a model with the elements in it already.  I need to display these elements in a diagram.  I do not need to create new elements.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #6 on: June 06, 2013, 09:15:11 pm »
In that case: they are one of those "invisible" elements like notes, fork/join and others. In order to copy them got to the original one in a diagram and ctrl-c; then ctrl-v in the other diagram. That's currently the only way.

However, I think it's a bug that lozenges are amongst the invisibles.

q.
« Last Edit: June 06, 2013, 09:15:31 pm by qwerty »

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #7 on: June 06, 2013, 09:24:01 pm »
Cheers qwerty, this is what I'm beginning to think too.  My problem is that the associations are created outside of the EA GUI and are not in any diagrams to begin with.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #8 on: June 06, 2013, 10:15:47 pm »
If you create such elements automated you must (as long as they keep being invisible) ensure to represent them in at least a single diagram. The automation can however find these elements without having to look into a diagram.

q.

[edit]: Here's another crude way: if you name the lozenges you can find them via ctrl-f (or via a special find command, but then you can't distinguish them). Now make the search window float and drag it from the search window onto the diagram.
« Last Edit: June 06, 2013, 10:22:24 pm by qwerty »

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #9 on: June 06, 2013, 10:58:57 pm »
Superb! Thanks qwerty.  It works: I've created an SQL query in the search builder that names the objects at the end of the direct associations attached to n-ary associations.  I can now drag and drop the n-ary from the search results window into the diagrams.

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #10 on: June 14, 2013, 08:05:22 pm »
as an addendum: a bug report has been sent.

Also, the query wasn't the final story: with the SQL search builder you (I) cannot drag and drop or copy and paste a row in the results into a diagram.  My solution was double click the row in the results I wanted and add a temporary name to the association.  Then changed to a simple search and searched for the temporary name.  This then could be dragged and dropped from the search window into the diagram.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #11 on: June 14, 2013, 08:10:33 pm »
Good to know. Thanks for the update. Can you post the query which failed drag-n-drop?

q.

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #12 on: June 14, 2013, 08:48:15 pm »
It is a little convoluted, qwerty, but here you go.  I have n-ary associations that have directed associations linked to classes, these directed associations are stereotyped "place1" and "place2".  So I have a chain that looks a little like this:

[Class] <-- place1 -- [n-ary association] -- place2 --> [Class]

The query that fails is:

SELECT t_object_1.ea_guid AS CLASSGUID, t_object_1.Object_Type AS CLASSTYPE, t_object_1.Name, t_object.Name AS place1, t_object_2.Name AS place2
FROM t_object AS t_object_2 INNER JOIN ((t_object INNER JOIN (t_object AS t_object_1 INNER JOIN t_connector AS t_connector_1 ON t_object_1.Object_ID = t_connector_1.Start_Object_ID) ON t_object.Object_ID = t_connector_1.End_Object_ID) INNER JOIN t_connector AS t_connector_2 ON t_object_1.Object_ID = t_connector_2.Start_Object_ID) ON t_object_2.Object_ID = t_connector_2.End_Object_ID
WHERE (((t_object_1.Object_Type)="Association") AND ((t_connector_1.Stereotype)="place1") AND ((t_connector_2.Stereotype)="place2"))
ORDER BY t_object.Name;

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #13 on: June 15, 2013, 09:06:13 pm »
This rather looks like a bug in EA and should be reported. It is possible to d-n-d classes but not associations when using SQL. But it IS possible to d-n-d both when using the search builder.

q.

mitchell.boro

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Insert Related N-ary Associations - version 10
« Reply #14 on: June 17, 2013, 08:07:52 pm »
q.

A bug report has been sent.