Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Introducing Activity Diagrams

The Activity diagram is a diagram that can be used to show the sequence of Actions that describe the behavior of a Block or other structural element. The Actions are sequenced using control flows, and can contain input and output Pins that act as buffers for items that flow from one Action to another (or from Control or buffer Nodes). The work carried out by the Actions either consumes or produces these items. The items can be either material, energy, or information, depending on the system and the activity being described.

Creating Activity Diagrams

An Activity diagram can be created from a number of places in the User Interface such as the:

  • Design Ribbon - 'Add' Diagram icon on the 'Diagram' panel
  • Browser Toolbar - New Diagram icon
  • Browser Context Menu - New Diagram

We will use the Design Ribbon to create an Activity diagram. Firstly, select the location in the Browser where you want the Activity diagram to be created. As with all diagrams, this can be either a Package or an element, but it is common to insert Activity diagrams into a Package. Once the Package location has been selected in the Browser, select the ribbon option:

     Design > Diagram > Add Diagram

Diagram panel of the Design ribbon in Sparx Systems Enterprise Architect.

Selecting this option will open the New Diagram dialog, allowing you to change the name of the diagram (which defaults to the name of the Package or element that contains the diagram, as selected in the Browser). With the SysML perspective chosen and the version of SysML selected, a list of diagrams will be displayed from which you select the Activity diagram. When you click on the OK button, a new Activity diagram will be created in the location selected in the Browser. The diagram canvas will be opened, allowing you to start adding elements and connectors that describe the value that the system will provide to its users. Enterprise Architect will also display the 'Activity' pages of the Toolbox, which contain the elements and relationships defined by the SysML specification to be applicable for constructing Activity diagrams. Any number of other Toolbox pages can be opened if required, in addition to the Common Elements and Common Relationships Toolbox pages that are always available.

The most import elements and connectors used with the Activity diagram are:

Elements

  • Activity
  • Action
  • Action Pin
  • Partition
  • Parameter
  • Initial
  • Final
  • Decision
  • Fork and Join
  • Data Store

Connectors

  • Control Flow
  • Object Flow
  • Interrupt Flow

There are many other elements and connectors that can be used on these diagrams that are important for more advanced modeling; some of these might be needed as modelers become more experienced, or more complex parts of a system's behavior are being described or designed. These include Activity Parameter, Merge, Central Buffer Node, Regions, Fork and Join, Decision and Merge.

Elements can be added to the diagram by dragging-and-dropping them from the Toolbox onto the diagram canvas. It is considered good practice to start with an Initial and one or more Final elements, which are named appropriately to describe the way the Activity starts and the potentially multiple ways it might finish. Leaving the name of these elements blank or giving them a name that is hackneyed such as 'starts' or 'end' will not help to make it clear to the reader what system or part of a system is being modeled, and can lead to misinterpretation of the diagram. When these nodes have been added and appropriately placed in the diagram, Actions and Object Nodes can be added to the diagram. The Actions can be connected using the Control Flow relationship, defining the sequence in which the Actions will be executed.

Once a basic diagram has been created, and as knowledge of the domain and the system's behaviors is further accrued, it is possible to structure or embellish the diagram using the additional elements and relationships including:

  • Control Structures for Object flows: Forks and Joins, Decision and Merge nodes
  • Activity Input and Output Structures: Activity Parameters (Streaming and Non-Streaming)
  • Grouping sets of Actions: Interruptible Regions and Edges
  • Token Storage Structures: Data Stores and Central Buffers

As stated earlier, the Activity diagram has a rich set of language devices and the engineer is encouraged to use these devices to make the system description richer, but some caution needs to be exercised to ensure that these language mechanisms can be understood by the intended audience.