Generate Diagrams

If you have created a structured scenario, you can generate any of the following diagrams from that scenario:

To generate the required diagram, follow the steps below:

  1. Create the scenario structure on the Structured Specification tab.
  2. Click on the Generate Diagram icon (Scengendiag) in the toolbar on the tab.
  3. Click on the type of diagram to generate.

Enterprise Architect generates the diagram and notifies you that generation is complete.  Close the Properties dialog to review the diagram.

If the diagram being generated already exists under the selected element, the following prompt displays:

DiagGenOpt

Select the appropriate radio button to:

  • Overwrite the existing diagram (delete the existing diagram and elements, and create a new diagram and elements) or
  • Synchronize the elements in the existing diagram with the scenario steps (however, Sequence and Robustness diagrams cannot be synchronized).

Note:

The Synchronize elements in existing diagram option enables the Preserve Diagram Layout checkbox, which you can select to preserve the existing arrangement of elements and connectors on the diagram. Any new elements are added to the diagram in the default position, and you manually position them in the diagram as required. If you do not select the checkbox, the diagram is recast in the default layout.

It is recommended that you uncheck the Preserve Diagram Layout checkbox if you are synchronizing elements with scenario steps:

  • When new steps have been added or existing steps have been deleted or moved within the Use Case
  • For the first time in a Use Case that has been imported from XMI with the Strip GUIDs option selected
  • For the first time in a Use Case that that has been copied and pasted in the Project Browser, or
  • For the first time in a Use Case whose containing package has been copied and pasted in the Project Browser.

Activity Diagram

An Activity is generated as a child of the selected element, to act as a container for the diagram. The scenario steps are modeled as Activities, and the values of the Uses, Results and State columns for each step are added as Tagged Values of the corresponding Activity.

ScenarioActivityD

Activity with ActivityParameter

The values of the Uses and Results columns are modeled as ActivityParameters.

The value of the State column is added as a Tagged Value of the Activities.

Note:

ActivityParameters are added to the Project Browser and not to the diagram.

Activity with Action

The scenario steps are modeled as Actions, and the values of the Uses, Results and State columns are added as Tagged Values of the Actions.

Activity with ActionPin

The scenario steps are modeled as Actions, and the values of the Uses and Results columns are modeled as Input Pins and Output Pins respectively.

The value of the State column is added as a Tagged Value of the Actions.

Note:

ActionPins are added to the Project Browser and not to the diagram.

RuleFlow Diagram

A Rule Flow Activity is created as a child of the selected element, to act as a container for the diagram. The scenario steps are modeled as RuleTasks, and the values of the Uses, Results and State columns are added as Tagged Values of the RuleTasks.

State Machine Diagram

A StateMachine is created as a child of the selected element, to act as a container for the diagram. Each value in the State column is modeled as a State.

The scenario steps become the Transition connectors between the States, and the values of the Uses and Results columns are added as Tagged Values of the Transitions.

ScenarioState

Sequence Diagram

Note:

All the elements involved in the scenario should be identified in the Context Reference tab. That is, relationships must already exist between the scenario parent element and the other elements named in the scenario.

An Interaction is created as a child of the selected element, to act as a container for the diagrams - the Basic, Alternate and Exception paths are modeled as separate Sequence diagrams under the Interaction.

Each Context Reference element named in a scenario step is modeled as a Lifeline. The step itself becomes the Message between an originator and its destination(s); the first Context Reference element in a step is treated as the originator, and the subsequent Context Reference element(s) become the destination(s).

Note:

Because the diagram generator acts on element names in the step, you should take care to avoid using the element names as normal text. For example, in step 1 in the dialog below, the term ATM-Card is interpreted as a reference to the ATM element, and two Customer inserts ATM-Card into ATM Messages are generated for the step. (To avoid confusion, in the diagram the first Message has been deleted.)

The values of the Uses, Results and State columns are added as Tagged Values of the Message.

ScenSeqDialog

ScenarioSequence

Robustness Diagram

A Collaboration is created as a child of the selected element, to act as a container for the Robustness diagram.

Notes:

  • All the elements involved in the scenario should be identified in the Context Reference tab. That is, relationships must already exist between the scenario parent element and the other elements named in the scenario.
  • Any values in the Uses, Results and State columns are ignored and not represented in the diagram.
  • Each UI element in a step becomes a Boundary element.  A Dependency relationship is created from this Boundary element to the UI element (this connector is not shown on the diagram).
  • Each Actor referenced in a step is dropped into the Robustness diagram as a simple link.
  • Each Class referenced in a step is dropped into the Robustness diagram as a simple link, and is given the stereotype entity.
  • Each step with a System trigger becomes a Controller. Alternate/exception path Controllers are displayed with a red background color.
  • Each step with a User trigger becomes the name of the Association between Controllers.

Scenrobustdiag

Robust