Behavioral Diagrams: Activity Diagrams
SysML Behavioral Diagram Types
Behavioral Related
5. Use Case Diagrams (uc)
what the system can do for the users
6. Activity Diagrams (act)
process & flow
7. State Machine Diagrams (stm)
modes of system
8. Sequence Diagrams (seq)
message flow over time
Activity Diagrams (act)
What is a SysML Activity diagram? Several Different Definitions from the Experts
Activity: An Activity (notation: rounded-rectangle or "roundangle") represents a flow of functional behaviors that may include optional Object (data) Flows. Control and Object Flows can be sequential (default) or parallel (indicated by Fork & Join Nodes) depending upon conditions.
Action = atomic Activity, which is a primitive executable behavior.
Control Flow = flow of functional behaviors
Object Flow = data flow of object inputs/outputs into/from an Activity or Action.
Activity Diagram (act): An Activity diagram shows system dynamic behavior using a combined Control Flow and Object (data) Flow model.
Activities (and indirectly Activity diagrams) can be recursively decomposed ("nested") by alternating between Activity definitions and Call Behavior Action usages (See Usage Notes below.)
Activities and Actions can be Allocated (via to Partitions that represent Control Blocks (i.e., Blocks that represent the System, Subsystems, Sub-Subsystems, ..., atomic structures);
Data Blocks (i.e., Blocks that represent Persistent Data Stores) and Signals that contain Data Blocks can be Allocated to Activity Parameters and Action Pins;
compare and contrast: SA/SD DFDs, FFBDs, EFFBDs,IDEF0; BPMN BPDs.
Activity Diagram (act) Example
In this example, we are showing the logic behind recharging a phone's battery. We see the decision node which is the second diamond in the logic. We see the guard conditions which are conditions which determine the flow. Guard conditions are designated by [].
When to use an Activity Diagram
The Activity diagram can be used to model flow based behavior and is similar to the widely-available Flow Chart or Functional Flow diagrams that had been used extensively before the SysML specification was devised. They are typically used to show the way parts of the system behave, including the input and output of items and signals.
What is the purpose of an act?
The Activity diagram is the most important behavior diagram and can be used to model flow (discrete or continuous) based behavior where inputs are converted to outputs by traversing a sequence of actions that perform work on the items. They are analogous to the common flow chart diagram but have more sophisticated semantics and also allow Activities and Actions to be related to elements such as Blocks, Requirements and Use Cases.
The Actions that appear on the Activity diagrams can contain input or output pins that represent the interaction points where inputs are fed into an action and outputs are emitted.
The purpose of Activity diagrams is to specify dynamic system behaviors that Satisfy («satisfy» Dependency) system Functional Requirements using both Control and Object (data) Flows. When properly applied (See Usage Notes below) Activity diagrams are recursively scalable and simulatable.
Cameo act Toolbar
Elements of an Activity Diagram
Elements
The main elements that can appear in Activity diagrams are:
Activity: While the block is the fundamental element of structure, the activity is the primary element of behavior. The activity, like the block, is an element of definition and is reusable.
Action: This is similar to the part property but on the behavioral side. The action, like the part property, is an element of usage. There are several types of actions, most notable is the call behavior action.
Activity Partition: This is also called a swimlane. This is where elements of behavior are allocated to elements of structure. The name on the swimlane is always a structural element while the elements within the swimlane are always elements of behavior. A swimlane can either be factored as an element of definition swimlane or an element of usage swimlane. If it's an element of definition swimlane the swimlane title will be a block and the contents will be activities. If the swimlane is factored as an element of usage, the swimlane title will be a part property and the contents will be actions.
Note: You must not allocate an activity (def) to a part property (usage). You must not allocate an action (usage) to a block (def). It's just horrible modeling but Cameo will allow you to do it which is a shame.
Object Node
Central Buffer Node
DataStore
Decision: This is a logical node which is denoted with a sideways diamond. It always has one input and many outputs. The outputs will have guards which will help decide which alternative is chosen. This node directs tokens along the right path but does not add or delete tokens.
Merge: This is a logical node which is denoted with a sideways diamond with a black center. It will have many inputs and one output. It directs tokens along the right path but no guards are needed to allow direction. Merge nodes do not add or delete tokens.
Initial: This is the starting point of the activity (entire diagram). It is denoted with a black solid circle.
Activity Final: This is the ending point for the activity (entire diagram). Even if other tokens are working behaviors at other locations within the activity they are immediately terminated. The activity final is denoted with the circular target image.
Final Flow: This is the ending point for the specific token but not necessarily the activity (entire diagram). If there are other tokens they will not terminate. The final flow is denoted with a circle with an X through it.
The main connectors that can appear in Activity diagrams are:
Control Flow
Object Flow
Interrupt Flow
Dependency
NASCAR Example
NASCAR Example Explained
NASCAR Example Containment Tree
Walkthrough of NASCAR Example Activity Diagrams
This example shows how an activity can be built out in more detail over time. NASCAR 1 was built first and then refined into NASCAR 2. NASCAR 2 was later refined into NASCAR 3. The containment tree is shown on the left. The containment tree shows that activities such as "Left Turn" can be reused.