Sparx Systems Forum

Discussion => Uml Process => Topic started by: egeesken on August 08, 2017, 11:24:26 pm

Title: Reusing UML Sequence diagrams
Post by: egeesken on August 08, 2017, 11:24:26 pm

I am new in the area of modelling with the Enterprise Architect. We are in a huge Java project and we are trying to document a part of the existing system in the Enterprise Architect.
We want to reuse UML-Sequence diagrams to avoid duplicate diagrams or redundant information in the different UML-Sequence diagrams.
I have found some information about this reuse but I am not able to model what I want to.

I have learned, that I have to create a separate UML_Sequence diagram to reuse it in other diagrams.
This diagram should be dragged from the Project Browser into the "parent" diagram. The dropped diagram is wrapped into an "Interactive Occurency".
The frame is a "ref" frame.
Now I have to create a diagram gate in the "parent" diagram and connect it to the "reused" diagram.

And here are my questions:
In the "reused" sequence diagram is there an Actor or is the Actor replaced with a diagram gate?
In the property page of the "Interactive Occurency" there is a register card "Call" but I have no idea what element to select for that field.
How can I send a message (or call a method) from the "parent" diagram (lifeline) to the "reused" diagram?

Is there anywhere a step by step tutorial......something like "Reusing UML-Sequence diagrams in UML-Sequence diagrams for dummies"?

The reuse of these diagrams  would make the documentation much more readable and maintainable.

Can anyone help, please?

Title: Re: Reusing UML Sequence diagrams
Post by: qwerty on August 08, 2017, 11:34:55 pm
You don't reuse SDs or anything inside (except maybe for decorations). A SD always represents a unique message flow to illustrate some (complicated) behavior. So there's nothing you could/should reuse.

Title: Re: Reusing UML Sequence diagrams
Post by: egeesken on August 09, 2017, 12:53:06 am

I think there is a misunderstanding.
As documented in the sparx Enterprise Architect Documentation "" #Gate
There is a model component (Diagram Gate, Interactive Occurrence) to model a nested sequence diagrams in other sequence diagrams. From our point of view this is a helpful feature to referenz common used sequence diagrams e. g. the login procedure without duplicating the diagrams.

Title: Re: Reusing UML Sequence diagrams
Post by: qwerty on August 09, 2017, 01:19:03 am
Ah yes. I should read more carefully :-(

Indeed you use diagram gates to connect different SDs to unclutter structures that otherwise would not fit into a single SD. A gate is placed in a SD to represent the "space curvature" between two diagrams. So it's not a replacement for an instance. And actually a gate is an element that should be reused, so it will have the same name in both diagrams.

Title: Re: Reusing UML Sequence diagrams
Post by: Richard Freggi on August 09, 2017, 11:27:28 am
Hope this can help.

I think your question is about how to use UML instead of how to use the EA tool - if you understand UML 2.x, then what to do in Sparx EA will become obvious.

If I understand what you want to achieve, I suggest you read up on <<include>> and <<extend>> use cases.  That will help you map out exactly what sequence diagram can be reused, under what circumstances (use cases are the preferred way to show what a sequence diagram does). 

Then you can use combined fragments to implement <<include>> and <<extend>> in your sequence diagrams.  "Ref" fragments can be used for <<include>> and "alt" or "opt" fragments can be used for <<extend>>.  This will give you an accurate, precise and easy way to reuse sequence diagrams.

Sorry if I misunderstood the question!  Cheers