Sparx Systems Forum
Enterprise Architect => Uml Process => Topic started by: frankk on October 23, 2007, 05:53:09 am
-
I've searched and found that other people have asked this question, but I could not find an answer:
How do you draw a collaboration occurrence in EA?
-
Try setting Advanced/Multiplicity in the Properties window.
-
Sorry, TK, I don't get that at all. Set the multiplicity on what element? How does multiplicity change the type of element?
-
I suppose your collaboration is some Class element. Select it in the browser. Open the Properties/Advanced window and select a Multiplicity from the drop down. It should appear like {n..m} in the diagram.
If that's not what you desire I can't help.
-
I think we're not talking about the same thing. A "Collaboration Occurrence" is a specific type of element, i.e., a reference to a Collaboration. It looks like an ellipse with the name of the target collaboration centered inside it. It is not a Class element.
-
EA uses [a variation of?] a boundary for this.
I cannot remember where it is in the documentation, but it is (or at least used to be in EA 6.x) there.
David
[EDIT: Ha, there it is! Look up Collaboration | Element in EA Help - this works with EA 7.0 build 817 - to find the general topic. Then check Collaboration Occurrence - there is a hyperlink on the above page - to see how to reference this instance elsewhere.]
-
Well, you can create a boundary, then change its shape to an ellipse and its outline to 'dashed'. However, the label is still at the top (i.e., not centered). It would be nice to create a genuine coll. occ. semi-automatically.
-
Well, you can create a boundary, then change its shape to an ellipse and its outline to 'dashed'. However, the label is still at the top (i.e., not centered). It would be nice to create a genuine coll. occ. semi-automatically.
Well...
It is genuine (in that EA sees it and can reference it) and it issemi-automatic (in that it is certainly not fully automatic).
As to how EA renders collaborations, please look up the EA Help file references I cited. The EA notations - at least those in the EA Help file - correspond to those in the UML 2.1.1 Superstructure, diagrams 9.11 and 9.12, which seem to be what you describe.
David
-
Yes, I had seen that Help page, which led me to ask how to create that kind of an element :-)
By 'genuine' I meant one that (i) appears in the toolbox and (ii) display "Collaboration Occurrence" in its properties.
-
Try holding Ctrl while dragging a collaboration onto a diagram. If you select to create as instance you'll get what you want.
-
Sorry, drag it from where? I tried from the Toolbox and from the Project Browser and did not get an instance.
-
I guess from the browser. That will give the choice to convert it it an instance.
-
It has to be from the Browser. In order to have an instance, of something you need to specify the 'something' involved. The toolbox has 'generic' items, which do not yet have an identity. The browser has 'concrete' items, each of which has been set up. When you control-drag one of these onto a diagram you are creating an instance of the specified item.
-
Sorry again, but I'm still not getting a Coll. Occ. I can live without it.
-
Is it that you expect the multiplicity to occur in the collaboration element? Then you should report a bug to Sparx. Neither the collab nor its instance show the multiplicty. It was already missing in Nodes and other elements where it now appearing after a fix.
-
This has nothing to do with multiplicity. It's about the kind of element.
-
I see. I'm riding the wrong horse. However, you should give a pointer to Superstructures so it is clear what you mean. I've seen something with Collaboration Occurence there and I never made use of that. Is it that thingy with the horizontal dash line inside the dashed ellipsis?
-
My apologies. I'm referring to the element that appears in fig. 9.12 in the Superstructure, described in 9.3.4 CollaborationUse.
-
OK Frank,
Now we're making some progress. The EA documentation is somewhat inconsistent [yes Paolo, I hear you!] in the references it cites, and according to the reference you cite - or almost cite, please see the following note - there have been changes since UML 2.0.
Note: I am using the UML Superstructure specification with the OMG number 07-02-05 (without change bars) or 07-02-03 (with change bars). In these documents diagram 9.12 is found in section 9.3.3, just before the heading for section 9.3.4. I am assuming this is the correct reference.
Open the EA help file - use the file from build 817, which you can download from the Sparx site - and from the Contents look up The UML Dictionary | UML Elements | Basic Elements | Class. Immediately below this entry in the Contents tree you will find Collaboration and Collaboration Occurrence. Hopefully these describe the 'animal' you want to add to a diagram.
[The EA help file cites the older 2.0 UML specification, but hopefully you can work past that in your models.]
Unfortunately the EA help gives the impression that one can find the Collaboration element in the Class toolbar. Not so!
To get around this, what I did was hunt for this thing using the 'back door' method of shift-right-clicking on a diagram - I used a class diagram in my experiment, but you can do this from other diagrams as well.
So, here's how to get a Collaboration element:- Shift-right-click somewhere on the diagram surface.
- Traverse the context menus starting with Other | UML.
- Continue traversing to one of the following menus: Use Case, Object, or Composite.
- Choose the Collaboration element from the final menu above.
This should provide you with the element you need to construct diagram 9.12 in the UML 2.1.1 Superstructure, or the Collaboration entry in EA Help.
Does this move you closer?
David
-
Nope, sorry, that's a Collaboration element, not a Collaboration Occurrence element.
It's clearly depicted and described in the EA Help. I just can't anywhere that says how to create it!
-
Frank,
Are you referring to the two 'inside' collaboration-type animals in diagram 9.14, UML 2.1.1, 07-02-05?
EDIT: Back from an experiment or two, and...
I can get these things by applying what's been said earlier by other posters here.
I defined a 'first' Collaboration as above. I then created a new 'second' collaboration in a new composite structure diagram - simply because I was following the example cited above - and tried adding instances (i.e. occurrences) of the earlier collaboration.
[I did this by first enlarging the second collaboration, so things would fit, then control-dragging the first collaboration from the Project Browser onto the first collaboration. I answered the dialog to confirm that I wanted an instance rather than a simple link.]
Each time I did so I got a collaboration with a name in the form of ":First" [note the colon]. If I now double-click the instance to open the properties dialog, I can enter a name for this instance of the collaboration. I now see something like "MyName :First" displayed in the instance. [Note the space before the colon. I don't know if this is per the UML definition, an acceptable convention used by EA, or an error. But I always seem to get it.]
In any case, this seems to cover what you want to do. How well it stacks up semantically, and how closely it parallels the intent of the UML 2.1.1 metamodel, I'll leave to the rest of you to debate.
Let the fireworks begin!
David
-
Yes ('retail' and 'wholesale')
-
See my edit above, Frank.
-
Thanks for investigating. However, I still can't get it to work.
When I click/drag a collaboration, I get a prompt for frame, instance or hyperlink, not instance or link.
I have no idea what I'm doing wrong.
-
CONTROL-drag Frank.
Hold down the control key throughout. You should see a dialog named Paste Element.
You can change the setting for control-drag on this diagram. I would not advise doing so unless you are going to add a lot of instances at once.
-
Sorry, meant to type 'ctrl', not 'click'. It's not working for me.
-
Are you dragging an already-created collaboration from the Project Browser? To be clear, I am not referring to the Collaboration icon in the toolbox.
-
Yes
-
Then try just dragging the collaboration onto its 'parent.' Once you've done that, with the 'child' selected, right click the child and from the context menu choose Advanced | Convert to Instance.
Also, what kind of diagram are you working on? I don't know if this matters, but I am using a Composite Structure diagram.
-
I get the same dialog whether I hold down Ctrl or not. Converting to instance just gives me a blank frame. (I'm dragging to a Composite, too.)
-
Don't drag to a composite. [At least, it is not necessary when I do this.]
All I did was create a new parent collaboration - not an instance - on a composite structure diagram. I then dragged a corner of this element to make it larger, so I could drop things onto it and they would fit.
Then I added an instance of different collaboration element from the Project Browser (i.e. one that was already defined) by one of the methods we've discussed.
No magic involved.
-
As far as I can tell, that's exactly what I have done.
-
Try this with a completely new project Frank.
-
Sounds to me like you are trying to drag a collaboration diagram from the browser, not a collaoration element.
hth
bruce
-
Thanks bruce, it could well be something along those lines.
This is one of those things that's really easy once you've done it the first time, but almost impossible until then.
David
-
Sounds to me like you are trying to drag a collaboration diagram from the browser, not a collaoration element.
hth
bruce
Yes, that was it, exactly :-)
Thanks for everyone's help.
-
Bingo! We have a winner!
Thanks again bruce. As always you've seen through to the core of the problem.
-
Frankk is happy :-)