Activity diagrams are graphical representations of workflows of stepwise activities and actions[1] with support for choice, iteration and concurrency. In the Unified Modeling Language, activity diagrams are intended to model both computational and organizational processes (i.e., workflows), as well as the data flows intersecting with the related activities. Although activity diagrams primarily show the overall flow of control, they can also include elements showing the flow of data between activities through one or more data stores.
Abstract
Activity diagrams experience an increasing importance in the design and description of software systems. Unfortunately, previous approaches for automatic layout support fail or are just insufficient to capture the complexity of the related requirements. We propose a new approach tailored to the needs of activity diagrams which combines the advantages of two fundamental layout concepts called “Sugiyama’s approach” [Sugiyama et al. 1981] and “topology-shape-metrics approach” [Tamassia et al. 1988], originally developed for layered layouts of directed graphs and for orthogonal layout of undirected graphs respectively.
1 Introduction and Motivation
Activities and the corresponding activity diagrams belong to the basic concepts of the Unified Modeling Language (UML) which has become the standard modeling language for specifying, visualizing and documenting software systems. Activity diagrams are used for modeling behavioral logic like business processes or workflow. In the modern UML 2, they experienced an increasing importance. While they were considered as a special case of state diagrams in UML 1.x, they are now enriched with additional constructs that widens the range of their applicability. This make them more suitable for areas like economics or bio-informatics [Shegogue and Zheng 2005].
While automatic layout for class diagrams received considerable attention by developers of corresponding software tools and designers of fundamental concepts of diagramming, activity diagrams were considered either to be just a special case for tools supporting state diagrams or to be too complex to handle them by a direct application of basic layout algorithms.
Activity diagrams require properties different from those for class diagrams such that the concepts developed there cannot be transferred, although the experiences gained help with the design. Here the emphasis lies on partitions and flow, some properties that are influenced by the semantics of activity diagrams. Those properties have to be supported by an automatic layout algorithm because it is hard, or sometimes even impossible to place all elements appropriately by hand. Furthermore, an automatic layout algorithm with customizable layout options allows to include different user preferences.
The contribution of this paper is a summary of the needed requirements and aesthetics for drawing activity diagrams, and the elaboration of sophisticated graph drawing algorithms for a new layout approach which satisfies them. We do not introduce a completely new concept, but we show for the first time how to combine the two layout concepts “Sugiyama approach” and “topological-shape-metrics approach”, which were originally developed for layered layouts of directed graphs and for orthogonal layouts of undirected graphs respectively. We demonstrate how to extract the advantages from both methods and apply them successfully to the challenging problem of layout UML activity diagrams.
The rest of our paper is organized as follows: In Section 2 we discuss the requirements and aesthetic criteria of activity diagrams. Section 3 reviews the state-of-the-art of drawing activity diagrams and Section 4 describes the basic definitions and algorithms which provide the basis for our new visualization approach. In Section 5 we introduce our new concepts followed by a short discussion.
2 Requirements for the Layout
In this section we examine requirements for the automatic layout of activity diagrams. We therefore shortly introduce the notation elements. This is necessary to derive a graph theoretic concept to layout those diagrams. We also analyze aesthetics and standards for creating activity diagrams. The identified aesthetics and requirements are the basis for the design of our new layout algorithm.
2.1 Notation of UML 2 Activity Diagrams
In the following we give an overview of the visual notation of activity diagrams and identify the resulting requirements for the layout algorithm. We do not focus on semantics if not necessary. For further details have a look at the UML superstructure specification [OMG 2004].
An activity specifies the coordination of executions of actions using a control and data flow model. Each activity diagram shows exactly one activity. An activity is modeled as a labeled graph of activity nodes which are connected by edges denoting data or control flow. It can optionally be represented by a border rectangle containing all its elements and a name shown in the upper left corner. There are three different node types appearing in an activity – action, object and control nodes.
Action nodes are the basic elements of an activity. An action node may have outgoing and incoming edges denoting control or data flow to or from other nodes. There is two special kind of action nodes to handle signal events, the accept event and send signal action. Object nodes indicate an instance of a particular classifier.